diff options
| author | Amir Rajan <[email protected]> | 2020-07-30 16:45:24 -0500 |
|---|---|---|
| committer | Amir Rajan <[email protected]> | 2020-07-30 16:58:40 -0500 |
| commit | eb8b770e1952af371832f5f31e00dae09d498cf9 (patch) | |
| tree | 0884e11fedbfa01c7ce9f1e028cb6c43a13d2052 /docs | |
| parent | 8d000345a3489988e9e86ee9fda9dcc6c70b7012 (diff) | |
| download | dragonruby-game-toolkit-contrib-eb8b770e1952af371832f5f31e00dae09d498cf9.tar.gz dragonruby-game-toolkit-contrib-eb8b770e1952af371832f5f31e00dae09d498cf9.zip | |
OSS synced with 1.12.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/docs.css | 120 | ||||
| -rw-r--r-- | docs/docs.html | 1575 | ||||
| -rw-r--r-- | docs/docs.js | 99 | ||||
| -rw-r--r-- | docs/docs.txt | 1649 | ||||
| -rw-r--r-- | docs/docs_search.gif | bin | 0 -> 3142002 bytes | |||
| -rw-r--r-- | docs/parse_log.txt | 8822 | ||||
| -rw-r--r-- | docs/search_results.txt | 63 | ||||
| -rw-r--r-- | docs/todo/03-solids-and-borders.md | 126 | ||||
| -rw-r--r-- | docs/todo/04-lines.md | 108 | ||||
| -rw-r--r-- | docs/todo/05-sprites.md | 216 | ||||
| -rw-r--r-- | docs/todo/06-keyboard.md | 150 | ||||
| -rw-r--r-- | docs/todo/07-mouse.md | 48 | ||||
| -rw-r--r-- | docs/todo/08-controllers.md | 86 | ||||
| -rw-r--r-- | docs/todo/09-scaling.md | 87 | ||||
| -rw-r--r-- | docs/todo/99-todo.md | 89 |
15 files changed, 13238 insertions, 0 deletions
diff --git a/docs/docs.css b/docs/docs.css new file mode 100644 index 0000000..7be4b7c --- /dev/null +++ b/docs/docs.css @@ -0,0 +1,120 @@ +body { + padding-left: 25px; + padding-right: 25px; + padding-bottom: 50px; + max-width: 920px; + margin-left: auto; + margin-right: auto; + font-size: 16px; + font-family: 'Helvetica', 'Arial', sans-serif; + line-height: 1.5; + font-weight: 300; + background-color: #FFFFFF; + color: #111111; +} + +a { + color: #0077CC; + text-decoration: none; +} + +a:visited { + color: #4A6B82; +} + +.brand { + font-size: 25px; + color: black !important; +} + +.page-link { + margin-right: 15px; +} + +h1 { + font-size: 26px; + border-bottom: solid 1px silver; +} + +h2 { + font-size: 22px; + border-bottom: solid 1px silver; +} + +h3 { + font-size: 18px; + border-bottom: solid 1px silver; +} + +img { + padding: 2px; + max-width: 640px; + max-height: 320px; + border: solid 1px silver; + display: block; + margin-left: auto; + margin-right: auto; +} + +hr { + border: 0; + height: 2px; + margin:18px 0; + position:relative; + background: -moz-linear-gradient(left, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 10%, rgba(0,0,0,0.65) 50%, rgba(0,0,0,0) 90%, rgba(0,0,0,0) 100%); + background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(0,0,0,0)), color-stop(10%,rgba(0,0,0,0)), color-stop(50%,rgba(0,0,0,0.65)), color-stop(90%,rgba(0,0,0,0)), color-stop(100%,rgba(0,0,0,0))); + background: -webkit-linear-gradient(left, rgba(0,0,0,0) 0%,rgba(0,0,0,0) 10%,rgba(0,0,0,0.65) 50%,rgba(0,0,0,0) 90%,rgba(0,0,0,0) 100%); + background: -o-linear-gradient(left, rgba(0,0,0,0) 0%,rgba(0,0,0,0) 10%,rgba(0,0,0,0.65) 50%,rgba(0,0,0,0) 90%,rgba(0,0,0,0) 100%); + background: -ms-linear-gradient(left, rgba(0,0,0,0) 0%,rgba(0,0,0,0) 10%,rgba(0,0,0,0.65) 50%,rgba(0,0,0,0) 90%,rgba(0,0,0,0) 100%); + background: linear-gradient(left, rgba(0,0,0,0) 0%,rgba(0,0,0,0) 10%,rgba(0,0,0,0.65) 50%,rgba(0,0,0,0) 90%,rgba(0,0,0,0) 100%); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00000000', endColorstr='#00000000',GradientType=1 ); +} + +hr:before { + content: ""; + display: block; + border-top: solid 1px #f9f9f9; + width: 100%; + height: 1px; + position: absolute; + top: 50%; + z-index: 1; +} + +pre { + border: solid 1px silver; + padding: 10px; + font-size: 16px; + white-space: pre-wrap; + white-space: -moz-pre-wrap; + white-space: -pre-wrap; + white-space: -o-pre-wrap; + word-wrap: break-word; +} + +code { + padding-left: 2px; + padding-right: 2px; + padding-top: 1px; + padding-bottom: 1px; + background-color: #f0f0f0; + border-radius: 5px; +} + +iframe { + max-width: 100%; + display: block; + margin: 0 auto; +} + +.wordwrap { + white-space: pre-wrap; + white-space: -moz-pre-wrap; + white-space: -pre-wrap; + white-space: -o-pre-wrap; + word-wrap: break-word; +} + +blockquote { + font-style: italic; +} diff --git a/docs/docs.html b/docs/docs.html new file mode 100644 index 0000000..bb15adf --- /dev/null +++ b/docs/docs.html @@ -0,0 +1,1575 @@ +<html> + <head> + <title>DragonRuby Game Toolkit Documentation</title> + <link href="docs.css" rel="stylesheet" type="text/css" media="all"> + <script src="docs.js"></script> + </head> + <body> + <div id='toc'> + <h1>Table Of Contents</h1> +<ul> +<li><a href='#--dragonruby-game-toolkit-live-docs'>DragonRuby Game Toolkit Live Docs</a></li> +<li><a href='#--hello-world'>Hello World</a></li> +<li><a href='#--join-the-discord-and-subscribe-to-the-news-letter'>Join the Discord and Subscribe to the News Letter</a></li> +<li><a href='#--watch-some-intro-videos'>Watch Some Intro Videos</a></li> +<li><a href='#--getting-started-tutorial'>Getting Started Tutorial</a></li> +<li><a href='#--deploying-to-itch.io'>Deploying To Itch.io</a></li> +<li><a href='#--how-to-determine-what-frame-you-are-on'>How To Determine What Frame You Are On</a></li> +<li><a href='#--how-to-get-current-framerate'>How To Get Current Framerate</a></li> +<li><a href='#--how-to-render-a-sprite-using-an-array'>How To Render A Sprite Using An Array</a></li> +<li><a href='#--more-sprite-properties-as-an-array'>More Sprite Properties As An Array</a></li> +<li><a href='#--different-sprite-representations'>Different Sprite Representations</a></li> +<li><a href='#--how-to-render-a-label'>How To Render A Label</a></li> +<li><a href='#--a-colored-label'>A Colored Label</a></li> +<li><a href='#--extended-label-properties'>Extended Label Properties</a></li> +<li><a href='#--rendering-a-label-as-a--hash-'>Rendering A Label As A <code>Hash</code></a></li> +<li><a href='#--getting-the-size-of-a-piece-of-text'>Getting The Size Of A Piece Of Text</a></li> +<li><a href='#--how-to-play-a-sound'>How To Play A Sound</a></li> +<li><a href='#--using--args.state--to-store-your-game-state'>Using <code>args.state</code> To Store Your Game State</a></li> +<li><a href='#--frequently-asked-questions,-comments,-and-concerns'>Frequently Asked Questions, Comments, and Concerns</a></li> +<li><a href='#--docs---gtk--runtime-'><code>GTK::Runtime</code></a></li> +<li><a href='#--docs---gtk--runtime#calcstringbox-'><code>GTK::Runtime#calcstringbox</code></a></li> +<li><a href='#--docs---gtk--runtime#reset-'><code>GTK::Runtime#reset</code></a></li> +<li><a href='#--docs---array-'><code>Array</code></a></li> +<li><a href='#--docs---array#map-'><code>Array#map</code></a></li> +<li><a href='#--docs---array#each-'><code>Array#each</code></a></li> +<li><a href='#--docs---array#reject_nil-'><code>Array#reject_nil</code></a></li> +<li><a href='#--docs---array#reject_false-'><code>Array#reject_false</code></a></li> +<li><a href='#--docs---array#product-'><code>Array#product</code></a></li> +<li><a href='#--docs---array#map_2d-'><code>Array#map_2d</code></a></li> +<li><a href='#--docs---array#include_any?-'><code>Array#include_any?</code></a></li> +<li><a href='#--docs---array#any_intersect_rect?-'><code>Array#any_intersect_rect?</code></a></li> +<li><a href='#--docs---gtk--outputs-'><code>GTK::Outputs</code></a></li> +<li><a href='#--docs---gtk--outputs#borders-'><code>GTK::Outputs#borders</code></a></li> +<li><a href='#--docs---gtk--outputs#solids-'><code>GTK::Outputs#solids</code></a></li> +<li><a href='#--docs---gtk--mouse-'><code>GTK::Mouse</code></a></li> +<li><a href='#--docs---gtk--mousepoint-'><code>GTK::MousePoint</code></a></li> +<li><a href='#--docs---gtk--openentity-'><code>GTK::OpenEntity</code></a></li> +<li><a href='#--docs---gtk--openentity#as_hash-'><code>GTK::OpenEntity#as_hash</code></a></li> +<li><a href='#--docs---numeric#frame_index-'><code>Numeric#frame_index</code></a></li> +<li><a href='#--docs---kernel-'><code>Kernel</code></a></li> +<li><a href='#--docs---kernel--tick_count-'><code>Kernel::tick_count</code></a></li> +<li><a href='#--docs---kernel--global_tick_count-'><code>Kernel::global_tick_count</code></a></li> +</ul> + </div> + <div id='content'> + </ol> +<h1 id='--dragonruby-game-toolkit-live-docs'>DragonRuby Game Toolkit Live Docs</h1> +<p> +The information contained here is all available via the DragonRuby Console. You can Open the DragonRuby Console by pressing [`] [~] [²] [^] [º] or [§] within your game. +</p> +<p> +To search docs you can type <code>docs_search "SEARCH TERM"</code> or if you want to get fancy you can provide a <code>lambda</code> to filter documentation: +</p> +</ol> +<pre>docs_search { |entry| (entry.include? "Array") && (!entry.include? "Enumerable") } +</pre> +<p> +<img src='docs_search.gif'></img> +</p> +</ol> +<h1 id='--hello-world'>Hello World</h1> +<p> +Welcome to DragonRuby Game Toolkit. Take the steps below to get started. +</p> +</ol> +<h1 id='--join-the-discord-and-subscribe-to-the-news-letter'>Join the Discord and Subscribe to the News Letter</h1> +<p> +Our Discord channel is <a href='http://discord.dragonruby.org'>http://discord.dragonruby.org</a>. +</p> +<p> +The News Letter will keep you in the loop with regards to current DragonRuby Events: <a href='http://dragonrubydispatch.com'>http://dragonrubydispatch.com</a>. +</p> +<p> +Those who use DragonRuby are called Dragon Riders. This identity is incredibly important to us. When someone asks you: +</p> +</ol> +<blockquote> +<p> +What game engine do you use? +</p> +</blockquote> +<p> +Reply with: +</p> +</ol> +<blockquote> +<p> +I am a Dragon Rider. +</p> +</blockquote> +</ol> +<h1 id='--watch-some-intro-videos'>Watch Some Intro Videos</h1> +<p> +Each video is only 20 minutes and all of them will fit into a lunch break. So please watch them: +</p> +<ol> +<li> Beginner Introduction to DragonRuby Game Toolkit: <a href='https://youtu.be/ixw7TJhU08E'>https://youtu.be/ixw7TJhU08E</a></li> +<li> Intermediate Introduction to Ruby Syntax: <a href='https://youtu.be/HG-XRZ5Ppgc'>https://youtu.be/HG-XRZ5Ppgc</a></li> +<li> Intermediate Introduction to Arrays in Ruby: <a href='https://youtu.be/N72sEYFRqfo'>https://youtu.be/N72sEYFRqfo</a></li> +</ol> +<p> +The second and third videos are not required if you are proficient with Ruby, but *definitely* watch the first one. +</p> +<p> +You may also want to try this free course provided at <a href='http://dragonruby.school'>http://dragonruby.school</a>. +</p> +</ol> +<h1 id='--getting-started-tutorial'>Getting Started Tutorial</h1> +<p> +This is a tutorial written by Ryan C Gordon (a Juggernaut in the industry who has contracted to Valve, Epic, Activision, and EA... check out his Wikipedia page: <a href='https://en.wikipedia.org/wiki/Ryan_C._Gordon'>https://en.wikipedia.org/wiki/Ryan_C._Gordon</a>). +</p> +</ol> +<h2>Introduction</h2> +<p> +Welcome! +</p> +<p> +Here's just a little push to get you started if you're new to programming or game development. +</p> +<p> +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> +<p> +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> +<p> +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> +</ol> +<h2>Prerequisites</h2> +<p> +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> +<p> +Do you know what an if statement is? A for-loop? An array? That's all you'll need to start. +</p> +</ol> +<h2>The Game Loop</h2> +<p> +Ok, here are few rules with regards to game development with GTK: +</p> +<ul> +<li>Your game is all going to happen under one function ...</li> +<li>that runs 60 times a second ...</li> +<li>and has to tell the computer what to draw each time.</li> +</ul> +<p> +That's an entire video game in one run-on sentence. +</p> +<p> +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> +</ol> +<pre>def tick args + args.outputs.labels << [580, 400, 'Hello World!'] +end +</pre> +<p> +Now run <code>dragonruby</code> ...did you get a window with "Hello World!" written in it? Good, you're officially a game developer! +</p> +</ol> +<h2>Breakdown Of The <code>tick</code> Method</h2> +<p> +<code>mygame/app/main.rb</code>, 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> +</ol> +<pre># 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, +# and every frame it will updated if keys are pressed, joysticks moved, +# mice clicked, etc. +def tick args + + # One of the things in "args" is the "outputs" object that your game uses + # to draw things. Afraid of rendering APIs? No problem. In DragonRuby, + # you use arrays to draw things and we figure out the details. + # If you want to draw text on the screen, you give it an array (the thing + # in the [ brackets ]), with an X and Y coordinate and the text to draw. + # The "<<" thing says "append this array onto the list of them at + # args.outputs.labels) + args.outputs.labels << [580, 400, 'Hello World!'] +end +</pre> +<p> +Once your <code>tick</code> 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> +</ol> +<h2>Rendering A Sprite</h2> +<p> +Now let's spice this up a little. +</p> +<p> +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> +<p> +There's a "dragonruby.png" file included, just to get you started. Let's have it draw every frame with our text: +</p> +</ol> +<pre>def tick args + args.outputs.labels << [580, 400, 'Hello World!'] + args.outputs.sprites << [576, 100, 128, 101, 'dragonruby.png'] +end +</pre> +<p> +(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> +<p> +That <code>.sprites</code> 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> +</ol> +<h2>Coordinate System and Virtual Canvas</h2> +<p> +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> +<p> +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> +<p> +Ok, now we have an image on the screen, let's animate it: +</p> +</ol> +<pre>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 +</pre> +<p> +Now you can see that this function is getting called a lot! +</p> +</ol> +<h2>Game State</h2> +<p> +Here's a fun Ruby thing: <code>args.state.rotation ||= 0</code> 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> +<p> +<code>args.state</code> is a place you can hang your own data and have it survive past the life of the function call. 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> +</ol> +<h2>There Is No Delta Time</h2> +<p> +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> +<p> +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> +</ol> +<h2>Handling User Input</h2> +<p> +Now, let's move that image around. +</p> +</ol> +<pre>def tick args + args.state.rotation ||= 0 + args.state.x ||= 576 + args.state.y ||= 100 + + if args.inputs.mouse.click + args.state.x = args.inputs.mouse.click.point.x - 64 + args.state.y = args.inputs.mouse.click.point.y - 50 + end + + args.outputs.labels << [580, 400, 'Hello World!'] + args.outputs.sprites << [args.state.x, + args.state.y, + 128, + 101, + 'dragonruby.png', + args.state.rotation] + + args.state.rotation -= 1 +end +</pre> +<p> +Everywhere you click your mouse, the image moves there. We set a default location for it with <code>args.state.x ||= 576</code>, 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> +</ol> +<h2>Coding On A Raspberry Pi</h2> +<p> +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> +<p> +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> +<p> +You're probably running a desktop environment: menus, apps, web browsers, etc. This is okay! Launch the terminal app and type: +</p> +</ol> +<pre>do raspi-config +</pre> +<p> +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> +<p> +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> +<p> +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> +</ol> +<h2>Conclusion</h2> +<p> +There is a lot more you can do with DragonRuby, but now you've already got just about everything you need to make a simple game. After all, even the most fancy games are just creating objects and moving them around. Experiment a little. Add a few more things and have them interact in small ways. Want something to go away? Just don't add it to <code>args.output</code> anymore. +</p> +</ol> +<h2>IMPORTANT: Go Through All Of The Sample Apps! Study Them Thoroughly!!</h2> +<p> +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> +<ol> +<li> 00_beginner_ruby_primer: This is an interactive tutorial that shows how to render <code>solid</code>s, animated <code>sprite</code>s, <code>label</code>s.</li> +<li> 00_intermediate_ruby_primer: This is a set of sample Ruby snippets that give you a high level introduction to the programming language.</li> +<li> 01_api_01_labels: Various ways to render <code>label</code>s.</li> +<li> 01_api_02_lines: Various ways to render <code>line</code>s.</li> +<li> 01_api_03_rects: Sample app shows various ways to render <code>solid</code>s and <code>border</code>s.</li> +<li> 01_api_04_sprites: Sample app shows various ways to render <code>sprite</code>s.</li> +<li> 01_api_05_keyboard: Hows how to get keyboard input from the user.</li> +<li> 01_api_06_mouse: Hows how to get mouse mouse position.</li> +<li> 01_api_07_point_to_rect: How to get mouse input from the user and shows collision/hit detection.</li> +<li> 01_api_08_rect_to_rect: Hit detection/collision between two rectangles.</li> +<li> 01_api_10_controller: Interaction with a USB/Bluetooth controller.</li> +<li> 01_api_99_tech_demo: All the different render primitives along with using <code>render_targets</code>.</li> +<li> 02_collision_01_simple: Collision detection with dynamically moving bodies.</li> +<li> 02_collision_02_moving_objects: Collision detection between many primitives, simple platformer physics, and keyboard input.</li> +<li> 02_collision_03_entities: Collision with entities and serves as a small introduction to ECS (entity component system).</li> +<li> 02_collision_04_ramp_with_debugging: How ramp trajectory can be calculated.</li> +<li> 02_collision_05_ramp_with_debugging_two: How ramp trajectory can be calculated.</li> +<li> 02_sprite_animation_and_keyboard_input: How to animate a sprite based off of keyboard input.</li> +<li> 03_mouse_click: How to determine what direction/vector a mouse was clicked relative to a player.</li> +<li> 04_sounds: How to play sounds and work with buttons.</li> +<li> 05_mouse_move: How to determine what direction/vector a mouse was clicked relative to a player.</li> +<li> 05_mouse_move_paint_app: Represents a simple paint app.</li> +<li> 05_mouse_move_tile_editor: A starting point for a tile editor.</li> +<li> 06_coordinate_systems: Shows the two origin systems within Game Toolkit where the origin is in the center and where the origin is at the bottom left.</li> +<li> 07_render_targets: Shows a powerful concept called <code>render_target</code>s. You can use this to programatically create sprites (it's also useful for representing parts of a scene as if it was a view port/camera).</li> +<li> 07_render_targets_advanced: Advanced usage of <code>render_target</code>s.</li> +<li> 08_platformer_collisions: Axis aligned collision along with platformer physics.</li> +<li> 08_platformer_collisions_metroidvania: How to save map data and place sprites live within a game.</li> +<li> 08_platformer_jumping_inertia: Jump physics and how inertia affects collision.</li> +<li> 09_controller_analog_usage_advanced_sprites: Extended properties of a <code>sprite</code> and how to change the rotation anchor point and render a subset/tile of a sprite.</li> +<li> 09_sprite_animation_using_tile_sheet: How to perform sprite animates using a tile sheet.</li> +<li> 10_save_load_game: Save and load game data.</li> +<li> 11_coersion_of_primitives: How primitives of one specific type can be rendered as another primitive type.</li> +<li> 11_hash_primitives: How primitives can be represented using a <code>Hash</code>.</li> +<li> 12_controller_input_sprite_sheet_animations: How to leverage vectors to move a player around the screen.</li> +<li> 12_top_down_area: How to render a top down map and how to manage collision of a player.</li> +<li> 13_01_easing_functions: How to use lerping functions to define animations/movement.</li> +<li> 13_02_cubic_bezier: How to create a bezier curve using lines.</li> +<li> 13_03_easing_using_spline: How a collection of bezier curves can be used to define an animation.</li> +<li> 13_04_parametric_enemy_movement: How to define the movement of enemies and projectiles using lerping/parametric functions.</li> +<li> 14_sprite_limits: Upper limit for how many sprites can be rendered to the screen.</li> +<li> 14_sprite_limits_static_references: Upper limit for how many sprites can be rendered to the screen using <code>static</code> output collections (which are updated by reference as opposed to by value).</li> +<li> 15_collision_limits: How many collisions can be processed across many primitives.</li> +<li> 18_moddable_game: How you can make a game where content is authored by the player (modding support).</li> +<li> 19_lowrez_jam_01_hello_world: How to use <code>render_targets</code> to create a low resolution game.</li> +<li> 19_lowrez_jam_02_buttons: How to use <code>render_targets</code> to create a low resolution game.</li> +<li> 19_lowrez_jam_03_space_shooter: How to use <code>render_targets</code> to create a low resolution game.</li> +<li> 20_roguelike_starting_point: A starting point for a roguelike and explores concepts such as line of sight.</li> +<li> 20_roguelike_starting_point_two: A starting point for a roguelike where sprites are provided from a tile map/tile sheet.</li> +<li> 21_mailbox_usage: How to do interprocess communication.</li> +<li> 22_trace_debugging: Debugging techniques and tracing execution through your game.</li> +<li> 22_trace_debugging_classes: Debugging techniques and tracing execution through your game.</li> +<li> 23_hexagonal_grid: How to make a tactical grid/map made of hexagons.</li> +<li> 23_isometric_grid: How to make a tactical grid/map made of isometric sprites.</li> +<li> 24_http_example: How to make http requests.</li> +<li> 25_3d_experiment_01_square: How to create 3D objects.</li> +<li> 26_jam_craft: Starting point for crafting game. It also shows how to customize the mouse cursor.</li> +<li> 99_sample_game_basic_gorillas: Reference implementation of a full game. Topics covered: physics, keyboard input, collision, sprite animation.</li> +<li> 99_sample_game_clepto_frog: Reference implementation of a full game. Topics covered: camera control, spring/rope physics, scene orchestration.</li> +<li> 99_sample_game_dueling_starships: Reference implementation that shows local multiplayer. Topics covered: vectors, particles, friction, inertia.</li> +<li> 99_sample_game_flappy_dragon: Reference implementation that is a clone of Flappy Bird. Topics covered: scene orchestration, collision, sound, sprite animations, lerping.</li> +<li> 99_sample_game_pong: Reference implementation of pong.</li> +<li> 99_sample_game_return_of_serenity: Reference implementation of low resolution story based game.</li> +<li> 99_sample_game_the_little_probe: Reference implementation of a full game. Topics covered: Arbitrary collision detection, loading map data, bounce/ball physics.</li> +<li> 99_sample_nddnug_workshop: Reference implementation of a full game. Topics covered: vectors, controller input, sound, trig functions.</li> +<li> 99_sample_snakemoji: Shows that Ruby supports coding with emojis.</li> +<li> 99_zz_gtk_unit_tests: A collection of unit tests that exercise parts of DragonRuby's API.</li> +</ol> +<h1 id='--deploying-to-itch.io'>Deploying To Itch.io</h1> +<p> +Once you've built your game, you're all set to deploy! Good luck in your game dev journey and if you get stuck, come to the Discord channel! +</p> +</ol> +<h2>Creating Your Game Landing Page</h2> +<p> +Log into Itch.io and go to <a href='https://itch.io/game/new'>https://itch.io/game/new</a>. +</p> +<ul> +<li>Title: Give your game a Title. This value represents your `gametitle`.</li> +<li>Project URL: Set your project url. This value represents your `gameid`.</li> +<li>Classification: Keep this as Game.</li> +<li>Kind of Project: Select HTML from the drop down list. Don't worry, + the HTML project type _also supports binary downloads_.</li> +<li>Uploads: Skip this section for now.</li> +</ul> +<p> +You can fill out all the other options later. +</p> +</ol> +<h2>Update Your Game's Metadata</h2> +<p> +Point your text editor at mygame/metadata/game_metadata.txt and make it look like this: +</p> +<p> +NOTE: Remove the <code>#</code> at the beginning of each line. +</p> +</ol> +<pre>vid=bob +vtitle=Bob The Game Developer +meid=mygame +metitle=My Game +rsion=0.1 +</pre> +<p> +The <code>devid</code> property is the username you use to log into Itch.io. The <code>devtitle</code> is your name or company name (it can contain spaces). The <code>gameid</code> is the Project URL value. The <code>gametitle</code> is the name of your game (it can contain spaces). The <code>version</code> can be any <code>major.minor</code> number format. +</p> +</ol> +<h2>Building Your Game For Distribution</h2> +<p> +Open up the terminal and run this from the command line: +</p> +</ol> +<pre>dragonruby-publish --only-package mygame +</pre> +<p> +(if you're on Windows, don't put the "./" on the front. That's a Mac and Linux thing.) +</p> +<p> +A directory called <code>./build</code> will be created that contains your binaries. You can upload this to Itch.io manually. +</p> +<p> +For the HTML version of your game after you upload it. Check the checkbox labeled "This file will be played in the browser". +</p> +<p> +For subsequent updates you can use an automated deployment to Itch.io: +</p> +</ol> +<pre>dragonruby-publish mygame +</pre> +<p> +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> +<p> +If you make changes to your game, just re-run dragonruby-publish and it'll update the downloads for you. +</p> +</ol> +<h2>DragonRuby's Philosophy</h2> +<p> +The following tenants of DragonRuby are what set us apart from other game engines. Given that Game Toolkit is a relatively new engine, there are definitely features that are missing. So having a big check list of "all the cool things" is not this engine's forte. This is compensated with a strong commitment to the following principals. +</p> +</ol> +<h3>Challenge The Status Quo</h3> +<p> +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> +</ol> +<blockquote> +<p> +But that's how we've always done it. +</p> +</blockquote> +<p> +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> +</ol> +<h3>Release Often And Quickly</h3> +<p> +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> +<p> +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> +<p> +Remember: +</p> +</ol> +<blockquote> +<p> +Real artists ship. +</p> +</blockquote> +</ol> +<h3>Sustainable And Ethical Monetization</h3> +<p> +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> +<p> +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> +</ol> +<h3>Sustainable And Ethical Open Source</h3> +<p> +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> +<p> +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> +</ol> +<h3>People Over Entities</h3> +<p> +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> +</ol> +<h3>Building A Game Should Be Fun And Bring Happiness</h3> +<p> +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> +</ol> +<h3>Real World Application Drives Features</h3> +<p> +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> +<p> +We want DragonRuby to *actually* help you build the game you want to build (as opposed to sell you something piece of demoware that doesn't work). +</p> +</ol> +<h1 id='--how-to-determine-what-frame-you-are-on'>How To Determine What Frame You Are On</h1> +<p> +There is a property on <code>state</code> called <code>tick_count</code> that is incremented by DragonRuby every time the <code>tick</code> method is called. The following code renders a label that displays the current <code>tick_count</code>. +</p> +</ol> +<pre>def tick args + args.outputs.labels << [10, 670, "#{args.state.tick_count}"] +end +</pre> +</ol> +<h1 id='--how-to-get-current-framerate'>How To Get Current Framerate</h1> +<p> +Current framerate is a top level property on the Game Toolkit Runtime and is accessible via <code>args.gtk.current_framerate</code>. +</p> +</ol> +<pre>def tick args + args.outputs.labels << [10, 710, "framerate: #{args.gtk.current_framerate.round}"] +end +</pre> +</ol> +<h1 id='--how-to-render-a-sprite-using-an-array'>How To Render A Sprite Using An Array</h1> +<p> +All file paths should use the forward slash <code>/</code> *not* backslash <code></code>. Game Toolkit includes a number of sprites in the <code>sprites</code> folder (everything about your game is located in the <code>mygame</code> directory). +</p> +<p> +The following code renders a sprite with a <code>width</code> and <code>height</code> of <code>100</code> in the center of the screen. +</p> +<p> +<code>args.outputs.sprites</code> is used to render a sprite. +</p> +</ol> +<pre>def tick args + args.outputs.sprites << [ + 640 - 50, # X + 360 - 50, # Y + 100, # W + 100, # H + 'sprites/square-blue.png' # PATH + ] +end +</pre> +</ol> +<h1 id='--more-sprite-properties-as-an-array'>More Sprite Properties As An Array</h1> +<p> +Here are all the properties you can set on a sprite. +</p> +</ol> +<pre>def tick args + args.outputs.sprites << [ + 100, # X + 100, # Y + 32, # W + 64, # H + 'sprites/square-blue.png', # PATH + 0, # ANGLE + 255, # ALPHA + 0, # RED_SATURATION + 255, # GREEN_SATURATION + 0 # BLUE_SATURATION + ] +end +</pre> +</ol> +<h1 id='--different-sprite-representations'>Different Sprite Representations</h1> +<p> +Using ordinal positioning can get a little unruly given so many properties you have control over. +</p> +<p> +You can represent a sprite as a <code>Hash</code>: +</p> +</ol> +<pre>def tick args + args.outputs.sprites << { + x: 640 - 50, + y: 360 - 50, + w: 100, + h: 100, + path: 'sprites/square-blue.png', + angle: 0, + a: 255, + r: 255, + g: 255, + b: 255, + source_x: 0, + source_y: 0, + source_w: -1, + source_h: -1, + flip_vertically: false, + flip_horizontally: false, + angle_anchor_x: 0.5, + angle_anchor_y: 1.0 + } +end +</pre> +<p> +You can represent a sprite as an <code>object</code>: +</p> +</ol> +<pre># Create type with ALL sprite properties AND primitive_marker +class Sprite + attr_accessor :x, :y, :w, :h, :path, :angle, :a, :r, :g, :b, + :source_x, :source_y, :source_w, :source_h, + :tile_x, :tile_y, :tile_w, :tile_h, + :flip_horizontally, :flip_vertically, + :angle_anchor_x, :angle_anchor_y + + def primitive_marker + :sprite + end +end + +class BlueSquare < Sprite + def initialize opts + @x = opts[:x] + @y = opts[:y] + @w = opts[:w] + @h = opts[:h] + @path = 'sprites/square-blue.png' + end +end + +def tick args + args.outputs.sprites << (BlueSquare.new x: 640 - 50, + y: 360 - 50, + w: 50, + h: 50) +end +</pre> +</ol> +<h1 id='--how-to-render-a-label'>How To Render A Label</h1> +<p> +<code>args.outputs.labels</code> is used to render labels. +</p> +<p> +Labels are how you display text. This code will go directly inside of the <code>def tick args</code> method. +</p> +<p> +Here is the minimum code: +</p> +</ol> +<pre>def tick args + # X Y TEXT + args.outputs.labels << [640, 360, "I am a black label."] +end +</pre> +</ol> +<h1 id='--a-colored-label'>A Colored Label</h1> +</ol> +<pre>def tick args + # A colored label + # X Y TEXT, RED GREEN BLUE ALPHA + args.outputs.labels << [640, 360, "I am a redish label.", 255, 128, 128, 255] +end +</pre> +</ol> +<h1 id='--extended-label-properties'>Extended Label Properties</h1> +</ol> +<pre>def tick args + # A colored label + # X Y TEXT SIZE ALIGNMENT RED GREEN BLUE ALPHA FONT FILE + args.outputs.labels << [ + 640, # X + 360, # Y + "Hello world", # TEXT + 0, # SIZE_ENUM + 1, # ALIGNMENT_ENUM + 0, # RED + 0, # GREEN + 0, # BLUE + 255, # ALPHA + "fonts/coolfont.ttf" # FONT + ] +end +</pre> +<p> +A <code>SIZE_ENUM</code> of <code>0</code> represents "default size". A <code>negative</code> value will decrease the label size. A <code>positive</code> value will increase the label's size. +</p> +<p> +An <code>ALIGNMENT_ENUM</code> of <code>0</code> represents "left aligned". <code>1</code> represents "center aligned". <code>2</code> represents "right aligned". +</p> +</ol> +<h1 id='--rendering-a-label-as-a--hash-'>Rendering A Label As A <code>Hash</code></h1> +<p> +You can add additional metadata about your game within a label, which requires you to use a `Hash` instead. +</p> +</ol> +<pre>def tick args + args.outputs.labels << { + x: 200, + y: 550, + text: "dragonruby", + size_enum: 2, + alignment_enum: 1, + r: 155, + g: 50, + b: 50, + a: 255, + font: "fonts/manaspc.ttf", + # You can add any properties you like (this will be ignored/won't cause errors) + game_data_one: "Something", + game_data_two: { + value_1: "value", + value_2: "value two", + a_number: 15 + } + } +end +</pre> +</ol> +<h1 id='--getting-the-size-of-a-piece-of-text'>Getting The Size Of A Piece Of Text</h1> +<p> +You can get the render size of any string using <code>args.gtk.calcstringbox</code>. +</p> +</ol> +<pre>def tick args + # TEXT SIZE_ENUM FONT + w, h = args.gtk.calcstringbox("some string", 0, "font.ttf") + + # NOTE: The SIZE_ENUM and FONT are optional arguments. + + # Render a label showing the w and h of the text: + args.outputs.labels << [ + 10, + 710, + # This string uses Ruby's string interpolation literal: #{} + "'some string' has width: #{w}, and height: #{h}." + ] +end +</pre> +</ol> +<h1 id='--how-to-play-a-sound'>How To Play A Sound</h1> +<p> +Sounds that end <code>.wav</code> will play once: +</p> +</ol> +<pre>def tick args + # Play a sound every second + if (args.state.tick_count % 60) == 0 + args.outputs.sounds << 'something.wav' + end +end +</pre> +<p> +Sounds that end <code>.ogg</code> is considered background music and will loop: +</p> +</ol> +<pre>def tick args + # Start a sound loop at the beginning of the game + if args.state.tick_count == 0 + args.outputs.sounds << 'background_music.ogg' + end +end +</pre> +<p> +If you want to play a <code>.ogg</code> once as if it were a sound effect, you can do: +</p> +</ol> +<pre>def tick args + # Play a sound every second + if (args.state.tick_count % 60) == 0 + args.gtk.queue_sound 'some-ogg.ogg' + end +end +</pre> +</ol> +<h1 id='--using--args.state--to-store-your-game-state'>Using <code>args.state</code> To Store Your Game State</h1> +<p> +<code>args.state</code> is a open data structure that allows you to define properties that are arbitrarily nested. You don't need to define any kind of <code>class</code>. +</p> +<p> +To initialize your game state, use the <code>||=</code> operator. Any value on the right side of <code>||=</code> will only be assigned _once_. +</p> +<p> +To assign a value every frame, just use the <code>=</code> operator, but _make sure_ you've initialized a default value. +</p> +</ol> +<pre>def tick args + # initialize your game state ONCE + args.player.x ||= 0 + args.player.y ||= 0 + args.player.hp ||= 100 + + # increment the x position of the character by one every frame + args.player.x += 1 + + # Render a sprite with a label above the sprite + args.outputs.sprites << [ + args.player.x, + args.player.y, + 32, 32, + "player.png" + ] + + args.outputs.labels << [ + args.player.x, + args.player.y - 50, + args.player.hp + ] +end +</pre> +</ol> +<h1 id='--frequently-asked-questions,-comments,-and-concerns'>Frequently Asked Questions, Comments, and Concerns</h1> +<p> +Here are questions, comments, and concerns that frequently come up. +</p> +</ol> +<h2>Frequently Asked Questions</h2> +</ol> +<h3>What is DragonRuby LLP?</h3> +<p> +DragonRuby LLP is a partnership of four devs who came together with the goal of bringing the aesthetics and joy of Ruby, everywhere possible. +</p> +<p> +Under DragonRuby LLP, we offer a number of products (with more on the way): +</p> +<ul> +<li>Game Toolkit (GTK): A 2D game engine that is compatible with modern + gaming platforms. [Home Page]() [FAQ Page]()</li> +<li>RubyMotion (RM): A compiler toolchain that allows you to build native, cross-platform mobile + apps. [Home Page]() [FAQ Page]()</li> +<li>Commandline Toolkit (CTK): A zero dependency, zero installation Ruby + environment that works on Windows, Mac, and Linux. [Home Page]() [FAQ Page]()</li> +</ul> +<p> +All of the products above leverage a shared core called DragonRuby. +</p> +<p> +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> +<p> +NOTE: We leave the "A DragonRuby LLP Product" off of this one because that just sounds really weird. +</p> +<p> +NOTE: Devs who use DragonRuby are "Dragon Riders/Riders of Dragons". That's a bad ass identifier huh? +</p> +</ol> +<h3>What is DragonRuby?</h3> +<p> +The response to this question requires a few subparts. First we need to clarify some terms. Specifically _language specification_ vs _runtime_. +</p> +</ol> +<h3>Okay... so what is the difference between a language specification and a runtime?</h3> +<p> +A runtime is an _implementation_ of a langauge specification. When people say "Ruby," they are usually referring to "the Ruby 3.0+ language specification implemented via the CRuby/MRI Runtime." +</p> +<p> +But, there are many Ruby Runtimes: CRuby/MRI, JRuby, Truffle, Rubinius, Artichoke, and (last but certainly not least) DragonRuby. +</p> +</ol> +<h3>Okay... what language specification does DragonRuby use then?</h3> +<p> +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> +</ol> +<h3>So... why another runtime?</h3> +<p> +The elevator pitch is: +</p> +<p> +DragonRuby is a Multilevel Cross-platform Runtime. The "multiple levels" within the runtime allows us to target platforms no other Ruby can target: PC, Mac, Linux, Raspberry Pi, WASM, iOS, Android, Nintendo Switch, PS4, Xbox, and Scadia. +</p> +</ol> +<h3>What does Multilevel Cross-platform mean?</h3> +<p> +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> +<ul> +<li>Level 1 we leverage a good portion of mRuby.</li> +<li>Level 2 consists of optimizations to mRuby we've made given that our + target platforms are well known.</li> +<li>Level 3 consists of portable C libraries and their Ruby + C-Extensions.</li> +</ul> +<p> +Levels 1 through 3 are fairly commonplace in many runtime implemenations (with level 1 being the most portable, and level 3 being the fastest). But the DragonRuby Runtime has taken things a bit further: +</p> +<ul> +<li>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 lowlevel multimedia component library that has been in active development for 22 years and counting).</li> +<li>Level 5 is a codegeneration layer which creates metadata that allows + for native interopability with host runtime libraries. It also includes OS specific message pump orchestrations.</li> +<li>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> +</ul> +<p> +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 seperation between these two worlds; and provides a means to add new platforms without going insane. +</p> +</ol> +<h3>Cool cool. So given that I understand everything to this point, can we answer the original question? What is DragonRuby?</h3> +<p> +DragonRuby is a Ruby runtime implentation that takes all the lessons we've learned from MRI/CRuby, and merges it with the latest and greatest compiler and OSS technologies. +</p> +</ol> +<h2>Frequent Comments</h2> +</ol> +<h3>But Ruby is dead.</h3> +<p> +Let's check the official source for the answer to this question: isrubydead.com: <a href='https://isrubydead.com/'>https://isrubydead.com/</a>. +</p> +<p> +On a more serious note, Ruby's _quantity_ levels aren't what they used to be. And that's totally fine. Every one chases the new and shiny. +</p> +<p> +What really matters is _quality/maturity_. Here is the latest (StackOverflow Survey sorted by highest paid developers)[https://insights.stackoverflow.com/survey/2019#top-paying-technologies]. +</p> +<p> +Let's stop making this comment shall we? +</p> +</ol> +<h3>But Ruby is slow.</h3> +<p> +That doesn't make any sense. A language specification can't be slow... it's a language spec. Sure, an _implementation/runtime_ can be slow though, but then we'd have to talk about which runtime. +</p> +</ol> +<h3>Dynamic langauges are slow.</h3> +<p> +They are certainly slower than statically compiled languages. With the processing power and compiler optimizations we have today, dynamic languages like Ruby are _fast enough_. +</p> +<p> +Unless you are writing in some form of intermediate representation by hand, your langauge 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> +<p> +NOTE: If you _are_ hand writing LLVM IR, we are always open to bringing on new partners with such a skillset. Email us ^_^. +</p> +</ol> +<h2>Frequent Concerns</h2> +</ol> +<h3>DragonRuby is not open source. That's not right.</h3> +<p> +The current state of open source is unsustainable. Contributors work for free, most all open source repositories are serverly understaffed, and burnout from core members is rampant. +</p> +<p> +We believe in open source very strongly. Parts of DragonRuby are infact, 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> +<p> +If you have ideas on how we can do this, email us! +</p> +<p> +If the reason above isn't sufficient, then definitely use something else. +</p> +</ol> +<h3>DragonRuby is for pay. You should offer a free version.</h3> +<p> +If you can afford to pay for DragonRuby, you should (and will). We don't go around telling writers that they should give us their books for free, and only require payment if we read the entire thing. It's time we stop asking that of software products. +</p> +<p> +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> +<p> +You qualify for a free, unrestricted license to DragonRuby products if any of the following items pertain to you: +</p> +<ul> +<li>Your income is below $2,000.00 (USD) per month.</li> +<li>You are under 18 years of age.</li> +<li>You are a student of any type: traditional public school, home + schooling, college, bootcamp, or online.</li> +<li>You are a teacher, mentor, or parent who wants to teach a kid how to code.</li> +<li>You work/worked in public service or at a charitable organization: + for example public office, army, or any 501(c)(3) organization.</li> +</ul> +<p> +Just contact Amir at [email protected] with a short explanation of your current situation and he'll set you up. No questions asked. +</p> +</ol> +<h3>But still, you should offer a free version. So I can try it out and see if I like it.</h3> +<p> +You can try our [web-based sandbox environment](). But it won't do the runtime justice. Or just come to our [Slack]() or [Discord]() channel and ask questions. We'd be happy to have a one on one video chat with you and show off all the cool stuff we're doing. +</p> +<p> +Seriously just buy it. Get a refund if you don't like it. We make it stupid easy to do so. +</p> +</ol> +<h3>I still think you should do a free version. Think of all people who would give it a shot.</h3> +<p> +Free isn't a sustainable financial model. We don't want to spam your email. We don't want to collect usage data off of you either. We just want to provide quality toolchains to quality developers (as opposed to a large quantity of developers). +</p> +<p> +The peiple 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> +</ol> +<h3>What if I build something with DragonRuby, but DragonRuby LLP becomes insolvent.</h3> +<p> +That won't happen if the development world stop asking for free stuff and non-trivially compensate open source developers. Look, we want to be able to work on the stuff we love, every day of our lives. And we'll go to great lengths to make that happen. +</p> +<p> +But, in the event that sad day comes, our partnershiop bylaws state that _all_ DragonRuby IP that can be legally open sourced, will be released under a permissive license. +</p> +</ol> +<h1 id='--docs---gtk--runtime-'><code>GTK::Runtime</code></h1> +<p> +The GTK::Runtime class is the core of DragonRuby. It is globally accessible via <code>$gtk</code>. +</p> +</ol> +<h1 id='--docs---gtk--runtime#calcstringbox-'><code>GTK::Runtime#calcstringbox</code></h1> +<p> +This function returns the width and height of a string. +</p> +</ol> +<pre>def tick args + args.state.string_size ||= args.gtk.calcstringbox "Hello World" + args.state.string_size_font_size ||= args.gtk.calcstringbox "Hello World" +end +</pre> +</ol> +<h1 id='--docs---gtk--runtime#reset-'><code>GTK::Runtime#reset</code></h1> +<p> +This function will reset Kernel.tick_count to 0 and will remove all data from args.state. +</p> +</ol> +<h1 id='--docs---array-'><code>Array</code></h1> +<p> +The Array class has been extend to provide methods that will help in common game development tasks. Array is one of the most powerful classes in Ruby and a very fundamental component of Game Toolkit. +</p> +</ol> +<h1 id='--docs---array#map-'><code>Array#map</code></h1> +<p> +The function given a block returns a new <code>Enumerable</code> of values. +</p> +<p> +Example of using <code>Array#map</code> in conjunction with <code>args.state</code> and <code>args.outputs.sprites</code> to render sprites to the screen. +</p> +</ol> +<pre>def tick args + # define the colors of the rainbow in ~args.state~ + # as an ~Array~ of ~Hash~es with :order and :name. + # :order will be used to determine render location + # and :name will be used to determine sprite path. + args.state.rainbow_colors ||= [ + { order: 0, name: :red }, + { order: 1, name: :orange }, + { order: 2, name: :yellow }, + { order: 3, name: :green }, + { order: 4, name: :blue }, + { order: 5, name: :indigo }, + { order: 6, name: :violet }, + ] + + # render sprites diagonally to the screen + # with a width and height of 50. + args.outputs + .sprites << args.state + .rainbow_colors + .map do |color| # <-- ~Array#map~ usage + [ + color[:order] * 50, + color[:order] * 50, + 50, + 50, + "sprites/square-#{color[:name]}.png" + ] + end +end +</pre> +</ol> +<h1 id='--docs---array#each-'><code>Array#each</code></h1> +<p> +The function, given a block, invokes the block for each item in the <code>Array</code>. <code>Array#each</code> is synonymous to foreach constructs in other languages. +</p> +<p> +Example of using <code>Array#each</code> in conjunction with <code>args.state</code> and <code>args.outputs.sprites</code> to render sprites to the screen: +</p> +</ol> +<pre>def tick args + # define the colors of the rainbow in ~args.state~ + # as an ~Array~ of ~Hash~es with :order and :name. + # :order will be used to determine render location + # and :name will be used to determine sprite path. + args.state.rainbow_colors ||= [ + { order: 0, name: :red }, + { order: 1, name: :orange }, + { order: 2, name: :yellow }, + { order: 3, name: :green }, + { order: 4, name: :blue }, + { order: 5, name: :indigo }, + { order: 6, name: :violet }, + ] + + # render sprites diagonally to the screen + # with a width and height of 50. + args.state + .rainbow_colors + .map do |color| # <-- ~Array#each~ usage + args.outputs.sprites << [ + color[:order] * 50, + color[:order] * 50, + 50, + 50, + "sprites/square-#{color[:name]}.png" + ] + end +end +</pre> +</ol> +<h1 id='--docs---array#reject_nil-'><code>Array#reject_nil</code></h1> +<p> +Returns an <code>Enumerable</code> rejecting items that are <code>nil</code>, this is an alias for <code>Array#compact</code>: +</p> +</ol> +<pre>repl do + a = [1, nil, 4, false, :a] + puts a.reject_nil + # => [1, 4, false, :a] + puts a.compact + # => [1, 4, false, :a] +end +</pre> +</ol> +<h1 id='--docs---array#reject_false-'><code>Array#reject_false</code></h1> +<p> +Returns an `Enumerable` rejecting items that are `nil` or `false`. +</p> +</ol> +<pre>repl do + a = [1, nil, 4, false, :a] + puts a.reject_false + # => [1, 4, :a] +end +</pre> +</ol> +<h1 id='--docs---array#product-'><code>Array#product</code></h1> +<p> +Returns all combinations of values between two arrays. +</p> +<p> +Here are some examples of using <code>product</code>. Paste the following code at the bottom of main.rb and save the file to see the results: +</p> +</ol> +<pre>repl do + a = [0, 1] + puts a.product + # => [[0, 0], [0, 1], [1, 0], [1, 1]] +end +</pre> +</ol> +<pre>repl do + a = [ 0, 1] + b = [:a, :b] + puts a.product b + # => [[0, :a], [0, :b], [1, :a], [1, :b]] +end +</pre> +</ol> +<h1 id='--docs---array#map_2d-'><code>Array#map_2d</code></h1> +<p> +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> +</ol> +<pre>repl do + stage = [ + [:enemy, :empty, :player], + [:empty, :empty, :empty], + [:enemy, :empty, :enemy], + ] + + occupied_tiles = stage.map_2d do |row, col, tile| + if tile == :empty + nil + else + [row, col, tile] + end + end.reject_nil + + puts "Stage:" + puts stage + + puts "Occupied Tiles" + puts occupied_tiles +end +</pre> +</ol> +<h1 id='--docs---array#include_any?-'><code>Array#include_any?</code></h1> +<p> +Given a collection of items, the function will return <code>true</code> if any of <code>self</code>'s items exists in the collection of items passed in: +</p> +</ol> +<h1 id='--docs---array#any_intersect_rect?-'><code>Array#any_intersect_rect?</code></h1> +<p> +Assuming the array contains objects that respond to <code>left</code>, <code>right</code>, <code>top</code>, <code>bottom</code>, this method returns <code>true</code> if any of the elements within the array intersect the object being passed in. You are given an optional parameter called <code>tolerance</code> which informs how close to the other rectangles the elements need to be for it to be considered intersecting. +</p> +<p> +The default tolerance is set to <code>0.1</code>, which means that the primitives are not considered intersecting unless they are overlapping by more than <code>0.1</code>. +</p> +</ol> +<pre>repl do + # Here is a player class that has position and implement + # the ~attr_rect~ contract. + class Player + attr_rect + attr_accessor :x, :y, :w, :h + + def initialize x, y, w, h + @x = x + @y = y + @w = w + @h = h + end + + def serialize + { x: @x, y: @y, w: @w, h: @h } + end + + def inspect + "#{serialize}" + end + + def to_s + "#{serialize}" + end + end + + # Here is a definition of two walls. + walls = [ + [10, 10, 10, 10], + { x: 20, y: 20, w: 10, h: 10 }, + ] + + # Display the walls. + puts "Walls." + puts walls + puts "" + + # Check any_intersect_rect? on player + player = Player.new 30, 20, 10, 10 + puts "Is Player #{player} touching wall?" + puts (walls.any_intersect_rect? player) + # => false + # The value is false because of the default tolerance is 0.1. + # The overlap of the player rect and any of the wall rects is + # less than 0.1 (for those that intersect). + puts "" + + player = Player.new 9, 10, 10, 10 + puts "Is Player #{player} touching wall?" + puts (walls.any_intersect_rect? player) + # => true + puts "" +end +</pre> +</ol> +<h1 id='--docs---gtk--outputs-'><code>GTK::Outputs</code></h1> +<p> +Outputs is how you render primitives to the screen. The minimal setup for rendering something to the screen is via a <code>tick</code> method defined in mygame/app/main.rb +</p> +</ol> +<pre>def tick args + # code goes here +end +</pre> +</ol> +<h1 id='--docs---gtk--outputs#borders-'><code>GTK::Outputs#borders</code></h1> +<p> +Add primitives to this collection to render an unfilled solid to the screen. Take a look at the documentation for Outputs#solids. +</p> +<p> +The only difference between the two primitives is where they are added. +</p> +<p> +Instead of using <code>args.outputs.solids</code>: +</p> +</ol> +<pre>def tick args + # X Y WIDTH HEIGHT + args.outputs.solids << [100, 100, 160, 90] +end +</pre> +<p> +You have to use <code>args.outputs.borders</code>: +</p> +</ol> +<pre>def tick args + # X Y WIDTH HEIGHT + args.outputs.borders << [100, 100, 160, 90] +end +</pre> +</ol> +<h1 id='--docs---gtk--outputs#solids-'><code>GTK::Outputs#solids</code></h1> +<p> +Add primitives to this collection to render a solid to the screen. +</p> +</ol> +<h2>Rendering a solid using an Array</h2> +<p> +Creates a solid black rectangle located at 100, 100. 160 pixels wide and 90 pixels tall. +</p> +</ol> +<pre>def tick args + # X Y WIDTH HEIGHT + args.outputs.solids << [100, 100, 160, 90] +end +</pre> +</ol> +<h2>Rendering a solid using an Array with colors and alpha</h2> +<p> +The value for the color and alpha is an number between <code>0</code> and <code>255</code>. The alpha property is optional and will be set to <code>255</code> if not specified. +</p> +<p> +Creates a green solid rectangle with an opacity of 50%. +</p> +</ol> +<pre>def tick args + # X Y WIDTH HEIGHT RED GREEN BLUE ALPHA + args.outputs.solids << [100, 100, 160, 90, 0, 255, 0, 128] +end +</pre> +</ol> +<h2>Rendering a solid using a Hash</h2> +<p> +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> +</ol> +<pre>def tick args + args.outputs.solids << { + x: 0, + y: 0, + w: 100, + h: 100, + r: 0, + g: 255, + b: 0, + a: 255 + } +end +</pre> +</ol> +<h2>Rendering a solid using a Class</h2> +<p> +You can also create a class with solid/border properties and render it as a primitive. ALL properties must on the class. *Additionally*, a method called <code>primitive_marker</code> must be defined on the class. +</p> +<p> +Here is an example: +</p> +</ol> +<pre># Create type with ALL solid properties AND primitive_marker +class Solid + attr_accessor :x, :y, :w, :h, :r, :g, :b, :a + + def primitive_marker + :solid + end +end + +# Inherit from type +class Square < Solid + # constructor + def initialize x, y, size + self.x = x + self.y = y + self.w = size + self.h = size + end +end + +def tick args + # render solid/border + args.outputs.solids << Square.new(10, 10, 32) +end +</pre> +</ol> +<h1 id='--docs---gtk--mouse-'><code>GTK::Mouse</code></h1> +<p> +The mouse is accessible via <code>args.inputs.mouse</code>: +</p> +</ol> +<pre>def tick args + # Rendering a label that shows the mouse's x and y position (via args.inputs.mouse). + args.outputs.labels << [ + 10, + 710, + "The mouse's position is: #{args.inputs.mouse.x} #{args.inputs.mouse.y}." + ] +end +</pre> +<p> +The mouse has the following properties. +</p> +<ul> +<li><code>args.inputs.mouse.x</code>: Returns the x position of the mouse.</li> +<li><code>args.inputs.mouse.y</code>: Returns the y position of the mouse.</li> +<li><code>args.inputs.mouse.moved</code>: Returns true if the mouse moved during the tick.</li> +<li><code>args.inputs.mouse.moved_at</code>: Returns the tick_count (<code>args.state.tick_count</code>) that the mouse was moved at. This property will be <code>nil</code> if the mouse didn't move.</li> +<li><code>args.inputs.mouse.global_moved_at</code>: Returns the global tick_count (<code>Kernel.global_tick_count</code>) that the mouse was moved at. This property will be <code>nil</code> if the mouse didn't move.</li> +<li><code>args.inputs.mouse.click</code>: Returns a <code>GTK::MousePoint</code> for that specific frame (<code>args.state.tick_count</code>) if the mouse button was pressed.</li> +<li><code>args.inputs.mouse.previous_click</code>: Returns a <code>GTK::MousePoint</code> for the previous frame (<code>args.state.tick_count - 1</code>) if the mouse button was pressed.</li> +<li><code>args.inputs.mouse.up</code>: Returns true if for that specific frame (<code>args.state.tick_count</code>) if the mouse button was released.</li> +<li><code>args.inputs.mouse.point</code> | <code>args.inputs.mouse.position</code>: Returns an <code>Array</code> which contains the <code>x</code> and <code>y</code> position of the mouse.</li> +<li><code>args.inputs.mouse.has_focus</code>: Returns true if the game window has the mouse's focus.</li> +<li><code>args.inputs.mouse.wheel</code>: Returns an <code>GTK::OpenEntity</code> that contains an <code>x</code> and <code>y</code> property which represents how much the wheel has moved. If the wheel has not moved within the tick, this property will be <code>nil</code>.</li> +<li><code>args.inputs.mouse.button_left</code>: Returns true if the left mouse button is down.</li> +<li><code>args.inputs.mouse.button_right</code>: Returns true if the right mouse button is down.</li> +<li><code>args.inputs.mouse.button_middle</code>: Returns true if the middle mouse button is down.</li> +<li><code>args.inputs.mouse.button_bits</code>: Gives the bits for each mouse button and its current state.</li> +</ul> +<h1 id='--docs---gtk--mousepoint-'><code>GTK::MousePoint</code></h1> +<p> +The <code>GTK::MousePoint</code> has the following properties. +</p> +<ul> +<li><code>x</code>: Integer representing the mouse's x.</li> +<li><code>y</code>: Integer representing the mouse's y.</li> +<li><code>point</code>: Array with the <code>x</code> and <code>y</code> values.</li> +<li><code>w</code>: Width of the point that always returns <code>0</code> (included so that it can seemlessly work with <code>GTK::Geometry</code> functions).</li> +<li><code>h</code>: Height of the point that always returns <code>0</code> (included so that it can seemlessly work with <code>GTK::Geometry</code> functions).</li> +<li><code>left</code>: This value is the same as <code>x</code> (included so that it can seemlessly work with <code>GTK::Geometry</code> functions).</li> +<li><code>right</code>: This value is the same as <code>x</code> (included so that it can seemlessly work with <code>GTK::Geometry</code> functions).</li> +<li><code>top</code>: This value is the same as <code>y</code> (included so that it can seemlessly work with <code>GTK::Geometry</code> functions).</li> +<li><code>bottom</code>: This value is the same as <code>y</code> (included so that it can seemlessly work with <code>GTK::Geometry</code> functions).</li> +<li><code>created_at</code>: The tick (<code>args.state.tick_count</code>) that this structure was created.</li> +<li><code>global_created_at</code>: The global tick (<code>Kernel.global_tick_count</code>) that this structure was created.</li> +</ul> +<h1 id='--docs---gtk--openentity-'><code>GTK::OpenEntity</code></h1> +<p> +<code>GTK::OpenEntity</code> is accessible within the DragonRuby's top level <code>tick</code> function via the <code>args.state</code> property. +</p> +</ol> +<pre>def tick args + args.state.x ||= 100 + args.outputs.labels << [10, 710, "value of x is: #{args.state.x}."] +end +</pre> +<p> +The primary benefit of using <code>args.state</code> as opposed to instance variables is that <code>GTK::OpenEntity</code> allows for arbitrary nesting of properties without the need to create intermediate objects. +</p> +<p> +For example: +</p> +</ol> +<pre>def tick args + # intermediate player object does not need to be created + args.state.player.x ||= 100 + args.state.player.y ||= 100 + args.outputs.labels << [ + 10, + 710, + "player x, y is:#{args.state.player.x}, #{args.state.player.y}." + ] +end +</pre> +</ol> +<h1 id='--docs---gtk--openentity#as_hash-'><code>GTK::OpenEntity#as_hash</code></h1> +<p> +Returns a reference to the <code>GTK::OpenEntity</code> as a <code>Hash</code>. This property is useful when you want to treat <code>args.state</code> as a <code>Hash</code> and invoke methods such as <code>Hash#each</code>. +</p> +<p> +Example: +</p> +</ol> +<pre>def tick args + args.state.x ||= 100 + args.state.y ||= 100 + values = args.state + .as_hash + .map { |k, v| "#{k} #{v}" } + + args.outputs.labels << values.map.with_index do |v, i| + [ + 10, + 710 - (30 * i), + v + ] + end +end +</pre> +</ol> +<h1 id='--docs---numeric#frame_index-'><code>Numeric#frame_index</code></h1> +<p> +This function is helpful for determining the index of frame-by-frame sprite animation. The numeric value <code>self</code> represents the moment the animation started. +</p> +<p> +<code>frame_index</code> takes three additional parameters: +</p> +<ul> +<li>How many frames exist in the sprite animation.</li> +<li>How long to hold each animation for.</li> +<li>Whether the animation should repeat.</li> +</ul> +<p> +<code>frame_index</code> will return <code>nil</code> if the time for the animation is out of bounds of the parameter specification. +</p> +<p> +Example using variables: +</p> +</ol> +<pre>def tick args + start_looping_at = 0 + number_of_sprites = 6 + number_of_frames_to_show_each_sprite = 4 + does_sprite_loop = true + + sprite_index = + start_looping_at.frame_index number_of_sprites, + number_of_frames_to_show_each_sprite, + does_sprite_loop + + sprite_index ||= 0 + + args.outputs.sprites << [ + 640 - 50, + 360 - 50, + 100, + 100, + "sprites/dragon-#{sprite_index}.png" + ] +end +</pre> +<p> +Example using named parameters: +</p> +</ol> +<pre>def tick args + start_looping_at = 0 + + sprite_index = + start_looping_at.frame_index count: 6, + hold_for: 4, + repeat: true, + tick_count_override: args.state.tick_count + + sprite_index ||= 0 + + args.outputs.sprites << [ + 640 - 50, + 360 - 50, + 100, + 100, + "sprites/dragon-#{sprite_index}.png" + ] +end +</pre> +</ol> +<h1 id='--docs---kernel-'><code>Kernel</code></h1> +<p> +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> +</ol> +<h1 id='--docs---kernel--tick_count-'><code>Kernel::tick_count</code></h1> +<p> +Returns the current tick of the game. This value is reset if you call $gtk.reset. +</p> +</ol> +<h1 id='--docs---kernel--global_tick_count-'><code>Kernel::global_tick_count</code></h1> +<p> +Returns the current tick of the application from the point it was started. This value is never reset. +</p> + + </div> + </body> +</html> diff --git a/docs/docs.js b/docs/docs.js new file mode 100644 index 0000000..4c5a69b --- /dev/null +++ b/docs/docs.js @@ -0,0 +1,99 @@ +function all_paragraphs() { + return Array.from(document.querySelectorAll("p")); +} + +function all_pres() { + return Array.from(document.querySelectorAll("pre")); +} + +function all_lists() { + return Array.from(document.querySelectorAll("li")); +} + +function all_anchors() { + return Array.from(document.querySelectorAll("a")); +} + +function all_headers() { + return Array.from([ + Array.from(document.querySelectorAll("h1")), + Array.from(document.querySelectorAll("h2")), + Array.from(document.querySelectorAll("h3")) + ].flat()); +} + +function all_searchable_elements() { + return Array.from([ + all_paragraphs(), + all_pres(), + all_lists(), + all_headers(), + all_anchors() + ].flat()); +} + +function hide_element(element) { + element.style.color = "rgb(0, 0, 0, 0.2)"; +} + +function show_element(element) { + element.style.color = ""; +} + +function show_all_searchable_elements() { + all_searchable_elements().forEach(show_element); +} + +function does_element_has_word(element, word) { + return element.innerText + .toLowerCase() + .includes(word.toLowerCase()); +} + +function perform_search(search_text) { + search_text = search_text || ""; + show_all_searchable_elements(); + var result_count = 0; + document.getElementById('search-count').innerHTML = " "; + if (search_text.length < 3) return; + + var tokens = search_text.split(" "); + + all_searchable_elements().forEach(function (element) { + tokens.forEach(function(word) { + if (does_element_has_word(element, word)) { + result_count += 1; + show_element(element); + } else { + hide_element(element); + } + }); + }); + + document.getElementById('search-count').innerHTML = result_count.toString() + " result(s) found."; +} + +function add_search() { + var search_html = ` + <div style='padding: 10px; border: solid 1px silver; background-color: white;'> + <input placeholder='search' type='text' id='search-term' style='width: 100%; padding: 5px; margin-bottom: 3px;' /> + <div id='search-count'> </div> + </div> +`; + + // create search div + var search_div = document.createElement("div"); + search_div.innerHTML = search_html; + document.body.insertBefore(search_div, document.body.firstChild); + search_div.style.position = 'fixed'; + search_div.style.right = '10px'; + search_div.style.width = '200px'; + + // wire up incremental search + var search_textbox = document.getElementById("search-term"); + search_textbox.onkeydown = function() { perform_search(search_textbox.value); }; +} + +document.addEventListener('DOMContentLoaded', function() { + add_search(); +}, false); diff --git a/docs/docs.txt b/docs/docs.txt new file mode 100644 index 0000000..8627f1b --- /dev/null +++ b/docs/docs.txt @@ -0,0 +1,1649 @@ +* DragonRuby Game Toolkit Live Docs + +The information contained here is all available via the DragonRuby +Console. You can Open the DragonRuby Console by pressing [`] [~] [²] +[^] [º] or [§] within your game. + +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: + +#+begin_src + docs_search { |entry| (entry.include? "Array") && (!entry.include? "Enumerable") } +#+end_src + +[[docs_search.gif]] + +* Hello World + +Welcome to DragonRuby Game Toolkit. Take the steps below to get started. + +* Join the Discord and Subscribe to the News Letter + +Our Discord channel is [[http://discord.dragonruby.org]]. + +The News Letter will keep you in the loop with regards to current +DragonRuby Events: [[http://dragonrubydispatch.com]]. + +Those who use DragonRuby are called Dragon Riders. This identity is +incredibly important to us. When someone asks you: + +#+begin_quote +What game engine do you use? +#+end_quote + +Reply with: + +#+begin_quote +I am a Dragon Rider. +#+end_quote + +* Watch Some Intro Videos + +Each video is only 20 minutes and all of them will fit into a lunch +break. So please watch them: + +1. Beginner Introduction to DragonRuby Game Toolkit: [[https://youtu.be/ixw7TJhU08E]] +2. Intermediate Introduction to Ruby Syntax: [[https://youtu.be/HG-XRZ5Ppgc]] +3. Intermediate Introduction to Arrays in Ruby: [[https://youtu.be/N72sEYFRqfo]] + +The second and third videos are not required if you are proficient +with Ruby, but *definitely* watch the first one. + +You may also want to try this free course provided at +[[http://dragonruby.school]]. + +* Getting Started Tutorial + +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]]). + +** Introduction + +Welcome! + +Here's just a little push to get you started if you're new to +programming or game development. + +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. + +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. + +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 + +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 + +Ok, here are few rules with regards to game development with GTK: + +- Your game is all going to happen under one function ... +- that runs 60 times a second ... +- and has to tell the computer what to draw each time. + +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. + +#+begin_src ruby + def tick args + args.outputs.labels << [580, 400, 'Hello World!'] + end +#+end_src + +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 + +~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. + +#+begin_src ruby + # 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, + # and every frame it will updated if keys are pressed, joysticks moved, + # mice clicked, etc. + def tick args + + # One of the things in "args" is the "outputs" object that your game uses + # to draw things. Afraid of rendering APIs? No problem. In DragonRuby, + # you use arrays to draw things and we figure out the details. + # If you want to draw text on the screen, you give it an array (the thing + # in the [ brackets ]), with an X and Y coordinate and the text to draw. + # The "<<" thing says "append this array onto the list of them at + # args.outputs.labels) + args.outputs.labels << [580, 400, 'Hello World!'] + end +#+end_src + +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 + +Now let's spice this up a little. + +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! + +There's a "dragonruby.png" file included, just to get you +started. Let's have it draw every frame with our text: + +#+begin_src ruby + def tick args + args.outputs.labels << [580, 400, 'Hello World!'] + args.outputs.sprites << [576, 100, 128, 101, 'dragonruby.png'] + end +#+end_src + +(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 + +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. + +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. + +Ok, now we have an image on the screen, let's animate it: + +#+begin_src ruby + 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 +#+end_src + +Now you can see that this function is getting called a lot! + +** 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. + +~args.state~ is a place you can hang your own data and have it survive +past the life of the function call. 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 + +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 + +Now, let's move that image around. + +#+begin_src ruby + def tick args + args.state.rotation ||= 0 + args.state.x ||= 576 + args.state.y ||= 100 + + if args.inputs.mouse.click + args.state.x = args.inputs.mouse.click.point.x - 64 + args.state.y = args.inputs.mouse.click.point.y - 50 + end + + args.outputs.labels << [580, 400, 'Hello World!'] + args.outputs.sprites << [args.state.x, + args.state.y, + 128, + 101, + 'dragonruby.png', + args.state.rotation] + + args.state.rotation -= 1 + end +#+end_src + +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 + +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. + +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. + +You're probably running a desktop environment: menus, apps, web browsers, +etc. This is okay! Launch the terminal app and type: + +#+begin_src +sudo raspi-config +#+end_src + +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. + +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. + +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 + +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!! + +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. + +1. 00_beginner_ruby_primer: This is an interactive tutorial that shows how to render ~solid~s, animated ~sprite~s, ~label~s. +2. 00_intermediate_ruby_primer: This is a set of sample Ruby snippets that give you a high level introduction to the programming language. +3. 01_api_01_labels: Various ways to render ~label~s. +4. 01_api_02_lines: Various ways to render ~line~s. +5. 01_api_03_rects: Sample app shows various ways to render ~solid~s and ~border~s. +6. 01_api_04_sprites: Sample app shows various ways to render ~sprite~s. +7. 01_api_05_keyboard: Hows how to get keyboard input from the user. +8. 01_api_06_mouse: Hows how to get mouse mouse position. +9. 01_api_07_point_to_rect: How to get mouse input from the user and shows collision/hit detection. +10. 01_api_08_rect_to_rect: Hit detection/collision between two rectangles. +11. 01_api_10_controller: Interaction with a USB/Bluetooth controller. +12. 01_api_99_tech_demo: All the different render primitives along with using ~render_targets~. +13. 02_collision_01_simple: Collision detection with dynamically moving bodies. +14. 02_collision_02_moving_objects: Collision detection between many primitives, simple platformer physics, and keyboard input. +15. 02_collision_03_entities: Collision with entities and serves as a small introduction to ECS (entity component system). +16. 02_collision_04_ramp_with_debugging: How ramp trajectory can be calculated. +17. 02_collision_05_ramp_with_debugging_two: How ramp trajectory can be calculated. +18. 02_sprite_animation_and_keyboard_input: How to animate a sprite based off of keyboard input. +19. 03_mouse_click: How to determine what direction/vector a mouse was clicked relative to a player. +20. 04_sounds: How to play sounds and work with buttons. +21. 05_mouse_move: How to determine what direction/vector a mouse was clicked relative to a player. +22. 05_mouse_move_paint_app: Represents a simple paint app. +23. 05_mouse_move_tile_editor: A starting point for a tile editor. +24. 06_coordinate_systems: Shows the two origin systems within Game Toolkit where the origin is in the center and where the origin is at the bottom left. +25. 07_render_targets: Shows a powerful concept called ~render_target~s. You can use this to programatically create sprites (it's also useful for representing parts of a scene as if it was a view port/camera). +26. 07_render_targets_advanced: Advanced usage of ~render_target~s. +27. 08_platformer_collisions: Axis aligned collision along with platformer physics. +28. 08_platformer_collisions_metroidvania: How to save map data and place sprites live within a game. +29. 08_platformer_jumping_inertia: Jump physics and how inertia affects collision. +30. 09_controller_analog_usage_advanced_sprites: Extended properties of a ~sprite~ and how to change the rotation anchor point and render a subset/tile of a sprite. +31. 09_sprite_animation_using_tile_sheet: How to perform sprite animates using a tile sheet. +32. 10_save_load_game: Save and load game data. +33. 11_coersion_of_primitives: How primitives of one specific type can be rendered as another primitive type. +34. 11_hash_primitives: How primitives can be represented using a ~Hash~. +35. 12_controller_input_sprite_sheet_animations: How to leverage vectors to move a player around the screen. +36. 12_top_down_area: How to render a top down map and how to manage collision of a player. +37. 13_01_easing_functions: How to use lerping functions to define animations/movement. +38. 13_02_cubic_bezier: How to create a bezier curve using lines. +39. 13_03_easing_using_spline: How a collection of bezier curves can be used to define an animation. +40. 13_04_parametric_enemy_movement: How to define the movement of enemies and projectiles using lerping/parametric functions. +41. 14_sprite_limits: Upper limit for how many sprites can be rendered to the screen. +42. 14_sprite_limits_static_references: Upper limit for how many sprites can be rendered to the screen using ~static~ output collections (which are updated by reference as opposed to by value). +43. 15_collision_limits: How many collisions can be processed across many primitives. +44. 18_moddable_game: How you can make a game where content is authored by the player (modding support). +45. 19_lowrez_jam_01_hello_world: How to use ~render_targets~ to create a low resolution game. +46. 19_lowrez_jam_02_buttons: How to use ~render_targets~ to create a low resolution game. +47. 19_lowrez_jam_03_space_shooter: How to use ~render_targets~ to create a low resolution game. +48. 20_roguelike_starting_point: A starting point for a roguelike and explores concepts such as line of sight. +49. 20_roguelike_starting_point_two: A starting point for a roguelike where sprites are provided from a tile map/tile sheet. +50. 21_mailbox_usage: How to do interprocess communication. +51. 22_trace_debugging: Debugging techniques and tracing execution through your game. +52. 22_trace_debugging_classes: Debugging techniques and tracing execution through your game. +53. 23_hexagonal_grid: How to make a tactical grid/map made of hexagons. +54. 23_isometric_grid: How to make a tactical grid/map made of isometric sprites. +55. 24_http_example: How to make http requests. +56. 25_3d_experiment_01_square: How to create 3D objects. +57. 26_jam_craft: Starting point for crafting game. It also shows how to customize the mouse cursor. +58. 99_sample_game_basic_gorillas: Reference implementation of a full game. Topics covered: physics, keyboard input, collision, sprite animation. +59. 99_sample_game_clepto_frog: Reference implementation of a full game. Topics covered: camera control, spring/rope physics, scene orchestration. +60. 99_sample_game_dueling_starships: Reference implementation that shows local multiplayer. Topics covered: vectors, particles, friction, inertia. +61. 99_sample_game_flappy_dragon: Reference implementation that is a clone of Flappy Bird. Topics covered: scene orchestration, collision, sound, sprite animations, lerping. +62. 99_sample_game_pong: Reference implementation of pong. +63. 99_sample_game_return_of_serenity: Reference implementation of low resolution story based game. +64. 99_sample_game_the_little_probe: Reference implementation of a full game. Topics covered: Arbitrary collision detection, loading map data, bounce/ball physics. +65. 99_sample_nddnug_workshop: Reference implementation of a full game. Topics covered: vectors, controller input, sound, trig functions. +66. 99_sample_snakemoji: Shows that Ruby supports coding with emojis. +67. 99_zz_gtk_unit_tests: A collection of unit tests that exercise parts of DragonRuby's API. + + + +* 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 + +Log into Itch.io and go to [[https://itch.io/game/new]]. + +- Title: Give your game a Title. This value represents your `gametitle`. +- Project URL: Set your project url. This value represents your `gameid`. +- Classification: Keep this as Game. +- Kind of Project: Select HTML from the drop down list. Don't worry, + the HTML project type _also supports binary downloads_. +- Uploads: Skip this section for now. + +You can fill out all the other options later. + +** 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. + +#+begin_src +devid=bob +devtitle=Bob The Game Developer +gameid=mygame +gametitle=My Game +version=0.1 +#+end_src + +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 + +Open up the terminal and run this from the command line: + +#+begin_src +./dragonruby-publish --only-package mygame +#+end_src + +(if you're on Windows, don't put the "./" on the front. That's a Mac and +Linux thing.) + +A directory called ~./build~ will be created that contains your +binaries. You can upload this to Itch.io manually. + +For the HTML version of your game after you upload it. Check the checkbox labeled +"This file will be played in the browser". + +For subsequent updates you can use an automated deployment to Itch.io: + +#+begin_src +./dragonruby-publish mygame +#+end_src + +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! + +If you make changes to your game, just re-run dragonruby-publish and it'll +update the downloads for you. + +** 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 + +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: + +#+begin_quote +But that's how we've always done it. +#+end_quote + +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. + +*** Release Often And Quickly + +The biggest mistake game devs make is spending too much time in +isolation building their game. Release something, however small, and +release it quickly. + +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 + +*** 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 + +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 + +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 + +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 + +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. + +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). + +* 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 +code renders a label that displays the current ~tick_count~. + +#+begin_src ruby + def tick args + args.outputs.labels << [10, 670, "#{args.state.tick_count}"] + end +#+end_src + +* 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~. + +#+begin_src ruby + def tick args + args.outputs.labels << [10, 710, "framerate: #{args.gtk.current_framerate.round}"] + end +#+end_src + +* 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~ +folder (everything about your game is located in the ~mygame~ directory). + +The following code renders a sprite with a ~width~ and ~height~ of +~100~ in the center of the screen. + +~args.outputs.sprites~ is used to render a sprite. + +#+begin_src ruby + def tick args + args.outputs.sprites << [ + 640 - 50, # X + 360 - 50, # Y + 100, # W + 100, # H + 'sprites/square-blue.png' # PATH + ] + end +#+end_src + +* More Sprite Properties As An Array + +Here are all the properties you can set on a sprite. + +#+begin_src ruby + def tick args + args.outputs.sprites << [ + 100, # X + 100, # Y + 32, # W + 64, # H + 'sprites/square-blue.png', # PATH + 0, # ANGLE + 255, # ALPHA + 0, # RED_SATURATION + 255, # GREEN_SATURATION + 0 # BLUE_SATURATION + ] + end +#+end_src + +* Different Sprite Representations + +Using ordinal positioning can get a little unruly given so many +properties you have control over. + +You can represent a sprite as a ~Hash~: + +#+begin_src ruby + def tick args + args.outputs.sprites << { + x: 640 - 50, + y: 360 - 50, + w: 100, + h: 100, + path: 'sprites/square-blue.png', + angle: 0, + a: 255, + r: 255, + g: 255, + b: 255, + source_x: 0, + source_y: 0, + source_w: -1, + source_h: -1, + flip_vertically: false, + flip_horizontally: false, + angle_anchor_x: 0.5, + angle_anchor_y: 1.0 + } + end +#+end_src + +You can represent a sprite as an ~object~: + +#+begin_src ruby + # Create type with ALL sprite properties AND primitive_marker + class Sprite + attr_accessor :x, :y, :w, :h, :path, :angle, :a, :r, :g, :b, + :source_x, :source_y, :source_w, :source_h, + :tile_x, :tile_y, :tile_w, :tile_h, + :flip_horizontally, :flip_vertically, + :angle_anchor_x, :angle_anchor_y + + def primitive_marker + :sprite + end + end + + class BlueSquare < Sprite + def initialize opts + @x = opts[:x] + @y = opts[:y] + @w = opts[:w] + @h = opts[:h] + @path = 'sprites/square-blue.png' + end + end + + def tick args + args.outputs.sprites << (BlueSquare.new x: 640 - 50, + y: 360 - 50, + w: 50, + h: 50) + end +#+end_src + +* How To Render A Label + +~args.outputs.labels~ is used to render labels. + +Labels are how you display text. This code will go directly inside of +the ~def tick args~ method. + +Here is the minimum code: + +#+begin_src + def tick args + # X Y TEXT + args.outputs.labels << [640, 360, "I am a black label."] + end +#+end_src + +* A Colored Label + +#+begin_src + def tick args + # A colored label + # X Y TEXT, RED GREEN BLUE ALPHA + args.outputs.labels << [640, 360, "I am a redish label.", 255, 128, 128, 255] + end +#+end_src + +* Extended Label Properties + +#+begin_src + def tick args + # A colored label + # X Y TEXT SIZE ALIGNMENT RED GREEN BLUE ALPHA FONT FILE + args.outputs.labels << [ + 640, # X + 360, # Y + "Hello world", # TEXT + 0, # SIZE_ENUM + 1, # ALIGNMENT_ENUM + 0, # RED + 0, # GREEN + 0, # BLUE + 255, # ALPHA + "fonts/coolfont.ttf" # FONT + ] + end +#+end_src + +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. + +An ~ALIGNMENT_ENUM~ of ~0~ represents "left aligned". ~1~ represents +"center aligned". ~2~ represents "right aligned". + +* 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. + +#+begin_src + def tick args + args.outputs.labels << { + x: 200, + y: 550, + text: "dragonruby", + size_enum: 2, + alignment_enum: 1, + r: 155, + g: 50, + b: 50, + a: 255, + font: "fonts/manaspc.ttf", + # You can add any properties you like (this will be ignored/won't cause errors) + game_data_one: "Something", + game_data_two: { + value_1: "value", + value_2: "value two", + a_number: 15 + } + } + end +#+end_src + +* Getting The Size Of A Piece Of Text + +You can get the render size of any string using ~args.gtk.calcstringbox~. + +#+begin_src ruby + def tick args + # TEXT SIZE_ENUM FONT + w, h = args.gtk.calcstringbox("some string", 0, "font.ttf") + + # NOTE: The SIZE_ENUM and FONT are optional arguments. + + # Render a label showing the w and h of the text: + args.outputs.labels << [ + 10, + 710, + # This string uses Ruby's string interpolation literal: #{} + "'some string' has width: #{w}, and height: #{h}." + ] + end +#+end_src + +* How To Play A Sound + +Sounds that end ~.wav~ will play once: + +#+begin_src ruby + def tick args + # Play a sound every second + if (args.state.tick_count % 60) == 0 + args.outputs.sounds << 'something.wav' + end + end +#+end_src + +Sounds that end ~.ogg~ is considered background music and will loop: + +#+begin_src ruby + def tick args + # Start a sound loop at the beginning of the game + if args.state.tick_count == 0 + args.outputs.sounds << 'background_music.ogg' + end + end +#+end_src + +If you want to play a ~.ogg~ once as if it were a sound effect, you can do: + +#+begin_src ruby + def tick args + # Play a sound every second + if (args.state.tick_count % 60) == 0 + args.gtk.queue_sound 'some-ogg.ogg' + end + end +#+end_src + +* 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 +~class~. + +To initialize your game state, use the ~||=~ operator. Any value on +the right side of ~||=~ will only be assigned _once_. + +To assign a value every frame, just use the ~=~ operator, but _make +sure_ you've initialized a default value. + +#+begin_src + def tick args + # initialize your game state ONCE + args.player.x ||= 0 + args.player.y ||= 0 + args.player.hp ||= 100 + + # increment the x position of the character by one every frame + args.player.x += 1 + + # Render a sprite with a label above the sprite + args.outputs.sprites << [ + args.player.x, + args.player.y, + 32, 32, + "player.png" + ] + + args.outputs.labels << [ + args.player.x, + args.player.y - 50, + args.player.hp + ] + end +#+end_src + +* Frequently Asked Questions, Comments, and Concerns + +Here are questions, comments, and concerns that frequently come +up. + +** 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. + +Under DragonRuby LLP, we offer a number of products (with more on the +way): + +- Game Toolkit (GTK): A 2D game engine that is compatible with modern + gaming platforms. [Home Page]() [FAQ Page]() +- RubyMotion (RM): A compiler toolchain that allows you to build native, cross-platform mobile + apps. [Home Page]() [FAQ Page]() +- Commandline Toolkit (CTK): A zero dependency, zero installation Ruby + environment that works on Windows, Mac, and Linux. [Home Page]() [FAQ Page]() + +All of the products above leverage a shared core called DragonRuby. + +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_. + +NOTE: We leave the "A DragonRuby LLP Product" off of this one because +that just sounds really weird. + +NOTE: Devs who use DragonRuby are "Dragon Riders/Riders of Dragons". That's a bad ass +identifier huh? + +*** What is DragonRuby? + +The response to this question requires a few subparts. First we need +to clarify some terms. Specifically _language specification_ vs _runtime_. + +*** Okay... so what is the difference between a language specification and a runtime? + +A runtime is an _implementation_ of a langauge specification. When +people say "Ruby," they are usually referring to "the Ruby 3.0+ language +specification implemented via the CRuby/MRI Runtime." + +But, there are many Ruby Runtimes: CRuby/MRI, JRuby, Truffle, Rubinius, Artichoke, +and (last but certainly not least) DragonRuby. + +*** Okay... what language specification does DragonRuby use then? + +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. + +*** So... why another runtime? + +The elevator pitch is: + +DragonRuby is a Multilevel Cross-platform Runtime. The "multiple levels" +within the runtime allows us to target platforms no other Ruby can +target: PC, Mac, Linux, Raspberry Pi, WASM, iOS, Android, Nintendo +Switch, PS4, Xbox, and Scadia. + +*** What does Multilevel Cross-platform mean? + +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): + +- Level 1 we leverage a good portion of mRuby. +- Level 2 consists of optimizations to mRuby we've made given that our + target platforms are well known. +- Level 3 consists of portable C libraries and their Ruby + C-Extensions. + +Levels 1 through 3 are fairly commonplace in many runtime +implemenations (with level 1 being the most portable, and level 3 +being the fastest). But the DragonRuby Runtime has taken things a +bit further: + +- 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 lowlevel multimedia + component library that has been in active development for 22 years + and counting). + +- Level 5 is a codegeneration layer which creates metadata that allows + for native interopability with host runtime libraries. It also + includes OS specific message pump orchestrations. + +- 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. + +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 seperation between these two +worlds; and provides a means to add new platforms without going insane. + +*** Cool cool. So given that I understand everything to this point, can we answer the original question? What is DragonRuby? + +DragonRuby is a Ruby runtime implentation that takes all the lessons +we've learned from MRI/CRuby, and merges it with the latest and greatest +compiler and OSS technologies. + +** Frequent Comments + +*** But Ruby is dead. + +Let's check the official source for the answer to this question: +isrubydead.com: [[https://isrubydead.com/]]. + +On a more serious note, Ruby's _quantity_ levels aren't what they used +to be. And that's totally fine. Every one chases the new and shiny. + +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]. + +Let's stop making this comment shall we? + +*** But Ruby is slow. + +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. + +*** Dynamic langauges are slow. + +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_. + +Unless you are writing in some form of intermediate representation by hand, +your langauge 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. + +NOTE: If you _are_ hand writing LLVM IR, we are always open to +bringing on new partners with such a skillset. Email us ^_^. + +** Frequent Concerns + +*** DragonRuby is not open source. That's not right. + +The current state of open source is unsustainable. Contributors work +for free, most all open source repositories are serverly understaffed, +and burnout from core members is rampant. + +We believe in open source very strongly. Parts of DragonRuby are +infact, 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. + +If you have ideas on how we can do this, email us! + +If the reason above isn't sufficient, then definitely use something else. + +*** DragonRuby is for pay. You should offer a free version. + +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. + +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. + +You qualify for a free, unrestricted license to DragonRuby products if +any of the following items pertain to you: + +- Your income is below $2,000.00 (USD) per month. +- You are under 18 years of age. +- You are a student of any type: traditional public school, home + schooling, college, bootcamp, or online. +- You are a teacher, mentor, or parent who wants to teach a kid how to code. +- You work/worked in public service or at a charitable organization: + for example public office, army, or any 501(c)(3) organization. + +Just contact Amir at [email protected] with a short +explanation of your current situation and he'll set you up. No +questions asked. + +*** But still, you should offer a free version. So I can try it out and see if I like it. + +You can try our [web-based sandbox environment](). But it won't do the +runtime justice. Or just come to our [Slack]() or [Discord]() channel +and ask questions. We'd be happy to have a one on one video chat with +you and show off all the cool stuff we're doing. + +Seriously just buy it. Get a refund if you don't like it. We make it +stupid easy to do so. + +*** I still think you should do a free version. Think of all people who would give it a shot. + +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). + +The peiple 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. + +*** What if I build something with DragonRuby, but DragonRuby LLP becomes insolvent. + +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. + +But, in the event that sad day comes, our partnershiop bylaws state that +_all_ DragonRuby IP that can be legally open sourced, will be released +under a permissive license. + +* DOCS: ~GTK::Runtime~ +The GTK::Runtime class is the core of DragonRuby. It is globally accessible via ~$gtk~. + +* DOCS: ~GTK::Runtime#calcstringbox~ +This function returns the width and height of a string. + +#+begin_src ruby + def tick args + args.state.string_size ||= args.gtk.calcstringbox "Hello World" + args.state.string_size_font_size ||= args.gtk.calcstringbox "Hello World" + end +#+end_src + +* DOCS: ~GTK::Runtime#reset~ +This function will reset Kernel.tick_count to 0 and will remove all data from args.state. + +* DOCS: ~Array~ + +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. + + +* DOCS: ~Array#map~ + +The function given a block returns a new ~Enumerable~ of values. + +Example of using ~Array#map~ in conjunction with ~args.state~ and +~args.outputs.sprites~ to render sprites to the screen. + +#+begin_src + def tick args + # define the colors of the rainbow in ~args.state~ + # as an ~Array~ of ~Hash~es with :order and :name. + # :order will be used to determine render location + # and :name will be used to determine sprite path. + args.state.rainbow_colors ||= [ + { order: 0, name: :red }, + { order: 1, name: :orange }, + { order: 2, name: :yellow }, + { order: 3, name: :green }, + { order: 4, name: :blue }, + { order: 5, name: :indigo }, + { order: 6, name: :violet }, + ] + + # render sprites diagonally to the screen + # with a width and height of 50. + args.outputs + .sprites << args.state + .rainbow_colors + .map do |color| # <-- ~Array#map~ usage + [ + color[:order] * 50, + color[:order] * 50, + 50, + 50, + "sprites/square-#{color[:name]}.png" + ] + end + end +#+end_src + + +* DOCS: ~Array#each~ + +The function, given a block, invokes the block for each item in the +~Array~. ~Array#each~ is synonymous to foreach constructs in other languages. + +Example of using ~Array#each~ in conjunction with ~args.state~ and +~args.outputs.sprites~ to render sprites to the screen: + +#+begin_src + def tick args + # define the colors of the rainbow in ~args.state~ + # as an ~Array~ of ~Hash~es with :order and :name. + # :order will be used to determine render location + # and :name will be used to determine sprite path. + args.state.rainbow_colors ||= [ + { order: 0, name: :red }, + { order: 1, name: :orange }, + { order: 2, name: :yellow }, + { order: 3, name: :green }, + { order: 4, name: :blue }, + { order: 5, name: :indigo }, + { order: 6, name: :violet }, + ] + + # render sprites diagonally to the screen + # with a width and height of 50. + args.state + .rainbow_colors + .map do |color| # <-- ~Array#each~ usage + args.outputs.sprites << [ + color[:order] * 50, + color[:order] * 50, + 50, + 50, + "sprites/square-#{color[:name]}.png" + ] + end + end +#+end_src + + +* DOCS: ~Array#reject_nil~ + +Returns an ~Enumerable~ rejecting items that are ~nil~, this is an alias +for ~Array#compact~: + +#+begin_src + repl do + a = [1, nil, 4, false, :a] + puts a.reject_nil + # => [1, 4, false, :a] + puts a.compact + # => [1, 4, false, :a] + end +#+end_src + + +* DOCS: ~Array#reject_false~ + +Returns an `Enumerable` rejecting items that are `nil` or `false`. + +#+begin_src + repl do + a = [1, nil, 4, false, :a] + puts a.reject_false + # => [1, 4, :a] + end +#+end_src + + +* DOCS: ~Array#product~ + +Returns all combinations of values between two arrays. + +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: + +#+begin_src + repl do + a = [0, 1] + puts a.product + # => [[0, 0], [0, 1], [1, 0], [1, 1]] + end +#+end_src + +#+begin_src + repl do + a = [ 0, 1] + b = [:a, :b] + puts a.product b + # => [[0, :a], [0, :b], [1, :a], [1, :b]] + end +#+end_src + + +* DOCS: ~Array#map_2d~ + +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. + +#+begin_src + repl do + stage = [ + [:enemy, :empty, :player], + [:empty, :empty, :empty], + [:enemy, :empty, :enemy], + ] + + occupied_tiles = stage.map_2d do |row, col, tile| + if tile == :empty + nil + else + [row, col, tile] + end + end.reject_nil + + puts "Stage:" + puts stage + + puts "Occupied Tiles" + puts occupied_tiles + end +#+end_src + + +* DOCS: ~Array#include_any?~ + +Given a collection of items, the function will return +~true~ if any of ~self~'s items exists in the collection of items passed in: + + +* DOCS: ~Array#any_intersect_rect?~ + +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. + +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~. + +#+begin_src + repl do + # Here is a player class that has position and implement + # the ~attr_rect~ contract. + class Player + attr_rect + attr_accessor :x, :y, :w, :h + + def initialize x, y, w, h + @x = x + @y = y + @w = w + @h = h + end + + def serialize + { x: @x, y: @y, w: @w, h: @h } + end + + def inspect + "#{serialize}" + end + + def to_s + "#{serialize}" + end + end + + # Here is a definition of two walls. + walls = [ + [10, 10, 10, 10], + { x: 20, y: 20, w: 10, h: 10 }, + ] + + # Display the walls. + puts "Walls." + puts walls + puts "" + + # Check any_intersect_rect? on player + player = Player.new 30, 20, 10, 10 + puts "Is Player #{player} touching wall?" + puts (walls.any_intersect_rect? player) + # => false + # The value is false because of the default tolerance is 0.1. + # The overlap of the player rect and any of the wall rects is + # less than 0.1 (for those that intersect). + puts "" + + player = Player.new 9, 10, 10, 10 + puts "Is Player #{player} touching wall?" + puts (walls.any_intersect_rect? player) + # => true + puts "" + end +#+end_src + + +* DOCS: ~GTK::Outputs~ + +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 + +#+begin_src + def tick args + # code goes here + end +#+end_src + + +* DOCS: ~GTK::Outputs#borders~ + +Add primitives to this collection to render an unfilled solid to the screen. Take a look at the +documentation for Outputs#solids. + +The only difference between the two primitives is where they are added. + +Instead of using ~args.outputs.solids~: + +#+begin_src + def tick args + # X Y WIDTH HEIGHT + args.outputs.solids << [100, 100, 160, 90] + end +#+end_src + +You have to use ~args.outputs.borders~: + +#+begin_src + def tick args + # X Y WIDTH HEIGHT + args.outputs.borders << [100, 100, 160, 90] + end +#+end_src + + +* DOCS: ~GTK::Outputs#solids~ + +Add primitives to this collection to render a solid to the screen. + +** Rendering a solid using an Array + +Creates a solid black rectangle located at 100, 100. 160 pixels +wide and 90 pixels tall. + +#+begin_src + def tick args + # X Y WIDTH HEIGHT + args.outputs.solids << [100, 100, 160, 90] + end +#+end_src + +** Rendering a solid using an Array with colors and alpha + +The value for the color and alpha is an number between ~0~ and ~255~. The +alpha property is optional and will be set to ~255~ if not specified. + +Creates a green solid rectangle with an opacity of 50%. + +#+begin_src + def tick args + # X Y WIDTH HEIGHT RED GREEN BLUE ALPHA + args.outputs.solids << [100, 100, 160, 90, 0, 255, 0, 128] + end +#+end_src + +** Rendering a solid using a Hash + +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. + +#+begin_src + def tick args + args.outputs.solids << { + x: 0, + y: 0, + w: 100, + h: 100, + r: 0, + g: 255, + b: 0, + a: 255 + } + end +#+end_src + +** Rendering a solid using a Class + +You can also create a class with solid/border properties and render it as a primitive. +ALL properties must on the class. *Additionally*, a method called ~primitive_marker~ +must be defined on the class. + +Here is an example: + +#+begin_src + # Create type with ALL solid properties AND primitive_marker + class Solid + attr_accessor :x, :y, :w, :h, :r, :g, :b, :a + + def primitive_marker + :solid + end + end + + # Inherit from type + class Square < Solid + # constructor + def initialize x, y, size + self.x = x + self.y = y + self.w = size + self.h = size + end + end + + def tick args + # render solid/border + args.outputs.solids << Square.new(10, 10, 32) + end +#+end_src + + +* DOCS: ~GTK::Mouse~ + +The mouse is accessible via ~args.inputs.mouse~: + +#+begin_src ruby + def tick args + # Rendering a label that shows the mouse's x and y position (via args.inputs.mouse). + args.outputs.labels << [ + 10, + 710, + "The mouse's position is: #{args.inputs.mouse.x} #{args.inputs.mouse.y}." + ] + end +#+end_src + +The mouse has the following properties. + +- ~args.inputs.mouse.x~: Returns the x position of the mouse. +- ~args.inputs.mouse.y~: Returns the y position of the mouse. +- ~args.inputs.mouse.moved~: Returns true if the mouse moved during the tick. +- ~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. +- ~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. +- ~args.inputs.mouse.click~: Returns a ~GTK::MousePoint~ for that specific frame (~args.state.tick_count~) if the mouse button was pressed. +- ~args.inputs.mouse.previous_click~: Returns a ~GTK::MousePoint~ for the previous frame (~args.state.tick_count - 1~) if the mouse button was pressed. +- ~args.inputs.mouse.up~: Returns true if for that specific frame (~args.state.tick_count~) if the mouse button was released. +- ~args.inputs.mouse.point~ | ~args.inputs.mouse.position~: Returns an ~Array~ which contains the ~x~ and ~y~ position of the mouse. +- ~args.inputs.mouse.has_focus~: Returns true if the game window has the mouse's focus. +- ~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~. +- ~args.inputs.mouse.button_left~: Returns true if the left mouse button is down. +- ~args.inputs.mouse.button_right~: Returns true if the right mouse button is down. +- ~args.inputs.mouse.button_middle~: Returns true if the middle mouse button is down. +- ~args.inputs.mouse.button_bits~: Gives the bits for each mouse button and its current state. + +* DOCS: ~GTK::MousePoint~ + +The ~GTK::MousePoint~ has the following properties. + +- ~x~: Integer representing the mouse's x. +- ~y~: Integer representing the mouse's y. +- ~point~: Array with the ~x~ and ~y~ values. +- ~w~: Width of the point that always returns ~0~ (included so that it can seemlessly work with ~GTK::Geometry~ functions). +- ~h~: Height of the point that always returns ~0~ (included so that it can seemlessly work with ~GTK::Geometry~ functions). +- ~left~: This value is the same as ~x~ (included so that it can seemlessly work with ~GTK::Geometry~ functions). +- ~right~: This value is the same as ~x~ (included so that it can seemlessly work with ~GTK::Geometry~ functions). +- ~top~: This value is the same as ~y~ (included so that it can seemlessly work with ~GTK::Geometry~ functions). +- ~bottom~: This value is the same as ~y~ (included so that it can seemlessly work with ~GTK::Geometry~ functions). +- ~created_at~: The tick (~args.state.tick_count~) that this structure was created. +- ~global_created_at~: The global tick (~Kernel.global_tick_count~) that this structure was created. + + +* DOCS: ~GTK::OpenEntity~ + +~GTK::OpenEntity~ is accessible within the DragonRuby's top level +~tick~ function via the ~args.state~ property. + +#+begin_src + def tick args + args.state.x ||= 100 + args.outputs.labels << [10, 710, "value of x is: #{args.state.x}."] + end +#+end_src + +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. + +For example: + +#+begin_src + def tick args + # intermediate player object does not need to be created + args.state.player.x ||= 100 + args.state.player.y ||= 100 + args.outputs.labels << [ + 10, + 710, + "player x, y is:#{args.state.player.x}, #{args.state.player.y}." + ] + end +#+end_src + + +* DOCS: ~GTK::OpenEntity#as_hash~ + +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~. + +Example: + +#+begin_src + def tick args + args.state.x ||= 100 + args.state.y ||= 100 + values = args.state + .as_hash + .map { |k, v| "#{k} #{v}" } + + args.outputs.labels << values.map.with_index do |v, i| + [ + 10, + 710 - (30 * i), + v + ] + end + end +#+end_src + + +* DOCS: ~Numeric#frame_index~ + +This function is helpful for determining the index of frame-by-frame + sprite animation. The numeric value ~self~ represents the moment the + animation started. + +~frame_index~ takes three additional parameters: + +- How many frames exist in the sprite animation. +- How long to hold each animation for. +- Whether the animation should repeat. + +~frame_index~ will return ~nil~ if the time for the animation is out +of bounds of the parameter specification. + +Example using variables: + +#+begin_src ruby + def tick args + start_looping_at = 0 + number_of_sprites = 6 + number_of_frames_to_show_each_sprite = 4 + does_sprite_loop = true + + sprite_index = + start_looping_at.frame_index number_of_sprites, + number_of_frames_to_show_each_sprite, + does_sprite_loop + + sprite_index ||= 0 + + args.outputs.sprites << [ + 640 - 50, + 360 - 50, + 100, + 100, + "sprites/dragon-#{sprite_index}.png" + ] + end +#+end_src + +Example using named parameters: + +#+begin_src ruby + def tick args + start_looping_at = 0 + + sprite_index = + start_looping_at.frame_index count: 6, + hold_for: 4, + repeat: true, + tick_count_override: args.state.tick_count + + sprite_index ||= 0 + + args.outputs.sprites << [ + 640 - 50, + 360 - 50, + 100, + 100, + "sprites/dragon-#{sprite_index}.png" + ] + end +#+end_src + + +* DOCS: ~Kernel~ + +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. + + +* DOCS: ~Kernel::tick_count~ + +Returns the current tick of the game. This value is reset if you call $gtk.reset. + + +* DOCS: ~Kernel::global_tick_count~ + +Returns the current tick of the application from the point it was started. This value is never reset. + + diff --git a/docs/docs_search.gif b/docs/docs_search.gif Binary files differnew file mode 100644 index 0000000..78168b4 --- /dev/null +++ b/docs/docs_search.gif diff --git a/docs/parse_log.txt b/docs/parse_log.txt new file mode 100644 index 0000000..5c1d663 --- /dev/null +++ b/docs/parse_log.txt @@ -0,0 +1,8822 @@ +* Processing True Lines +** Processing line: ~* DragonRuby Game Toolkit Live Docs~ +- Header detected. +*** True Line Result + +*** True Line Result +* DragonRuby Game Toolkit Live Docs +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~The information contained here is all available via the DragonRuby~ +** Processing line: ~Console. You can Open the DragonRuby Console by pressing [`] [~] [²]~ +** Processing line: ~[^] [º] or [§] within your game.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +The information contained here is all available via the DragonRuby Console. You can Open the DragonRuby Console by pressing [`] [~] [²] [^] [º] or [§] within your game. +** Processing line: ~To search docs you can type ~docs_search "SEARCH TERM"~ or if you want~ +** Processing line: ~to get fancy you can provide a ~lambda~ to filter documentation:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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: +** Processing line: ~#+begin_src~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src +** Processing line: ~ docs_search { |entry| (entry.include? "Array") && (!entry.include? "Enumerable") }~ +- Inside source: true +*** True Line Result + docs_search { |entry| (entry.include? "Array") && (!entry.include? "Enumerable") } +** 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_search.gif]]~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +[[docs_search.gif]] +** Processing line: ~* Hello World~ +- Header detected. +*** True Line Result + +*** True Line Result +* Hello World +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Welcome to DragonRuby Game Toolkit. Take the steps below to get started.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Welcome to DragonRuby Game Toolkit. Take the steps below to get started. +** Processing line: ~* Join the Discord and Subscribe to the News Letter~ +- Header detected. +*** True Line Result + +*** True Line Result +* Join the Discord and Subscribe to the News Letter +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Our Discord channel is [[http://discord.dragonruby.org]].~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Our Discord channel is [[http://discord.dragonruby.org]]. +** Processing line: ~The News Letter will keep you in the loop with regards to current~ +** Processing line: ~DragonRuby Events: [[http://dragonrubydispatch.com]].~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +The News Letter will keep you in the loop with regards to current DragonRuby Events: [[http://dragonrubydispatch.com]]. +** Processing line: ~Those who use DragonRuby are called Dragon Riders. This identity is~ +** Processing line: ~incredibly important to us. When someone asks you:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Those who use DragonRuby are called Dragon Riders. This identity is incredibly important to us. When someone asks you: +** Processing line: ~#+begin_quote~ +- Line was identified as a literal block. +*** True Line Result + +*** True Line Result +#+begin_quote +** Processing line: ~What game engine do you use?~ +** Processing line: ~#+end_quote~ +- Line was identified as a literal block. +*** True Line Result +What game engine do you use? +*** True Line Result +#+end_quote +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Reply with:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Reply with: +** Processing line: ~#+begin_quote~ +- Line was identified as a literal block. +*** True Line Result + +*** True Line Result +#+begin_quote +** Processing line: ~I am a Dragon Rider.~ +** Processing line: ~#+end_quote~ +- Line was identified as a literal block. +*** True Line Result +I am a Dragon Rider. +*** True Line Result +#+end_quote +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~* Watch Some Intro Videos~ +- Header detected. +*** True Line Result + +*** True Line Result +* Watch Some Intro Videos +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Each video is only 20 minutes and all of them will fit into a lunch~ +** Processing line: ~break. So please watch them:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Each video is only 20 minutes and all of them will fit into a lunch break. So please watch them: +** Processing line: ~1. Beginner Introduction to DragonRuby Game Toolkit: [[https://youtu.be/ixw7TJhU08E]]~ +- Line was identified as a start of a list. +*** True Line Result + +** Processing line: ~2. Intermediate Introduction to Ruby Syntax: [[https://youtu.be/HG-XRZ5Ppgc]]~ +- Line was identified as a continuation of a list. +*** True Line Result +1. Beginner Introduction to DragonRuby Game Toolkit: [[https://youtu.be/ixw7TJhU08E]] +** Processing line: ~3. Intermediate Introduction to Arrays in Ruby: [[https://youtu.be/N72sEYFRqfo]]~ +- Line was identified as a continuation of a list. +*** True Line Result +2. Intermediate Introduction to Ruby Syntax: [[https://youtu.be/HG-XRZ5Ppgc]] +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +3. Intermediate Introduction to Arrays in Ruby: [[https://youtu.be/N72sEYFRqfo]] +** Processing line: ~The second and third videos are not required if you are proficient~ +** Processing line: ~with Ruby, but *definitely* watch the first one.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +The second and third videos are not required if you are proficient with Ruby, but *definitely* watch the first one. +** Processing line: ~You may also want to try this free course provided at~ +** Processing line: ~[[http://dragonruby.school]].~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +You may also want to try this free course provided at [[http://dragonruby.school]]. +** Processing line: ~* Getting Started Tutorial~ +- Header detected. +*** True Line Result + +*** True Line Result +* Getting Started Tutorial +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~This is a tutorial written by Ryan C Gordon (a Juggernaut in the~ +** Processing line: ~industry who has contracted to Valve, Epic, Activision, and~ +** Processing line: ~EA... check out his Wikipedia page: [[https://en.wikipedia.org/wiki/Ryan_C._Gordon]]).~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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]]). +** Processing line: ~** Introduction~ +- Header detected. +*** True Line Result + +*** True Line Result +** Introduction +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Welcome!~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Welcome! +** Processing line: ~Here's just a little push to get you started if you're new to~ +** Processing line: ~programming or game development.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Here's just a little push to get you started if you're new to programming or game development. +** Processing line: ~If you want to write a game, it's no different than writing any other~ +** Processing line: ~program for any other framework: there are a few simple rules that~ +** Processing line: ~might be new to you, but more or less programming is programming no~ +** Processing line: ~matter what you are building.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~Did you not know that? Did you think you couldn't write a game because~ +** Processing line: ~you're a "web guy" or you're writing Java at a desk job? Stop letting~ +** Processing line: ~people tell you that you can't, because you already have everything~ +** Processing line: ~you need.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~Here, we're going to be programming in a language called "Ruby." In~ +** Processing line: ~the interest of full disclosure, I (Ryan Gordon) wrote the C parts of~ +** Processing line: ~this toolkit and Ruby looks a little strange to me (Amir Rajan wrote~ +** Processing line: ~the Ruby parts, discounting the parts I mangled), but I'm going to~ +** Processing line: ~walk you through the basics because we're all learning together, and~ +** Processing line: ~if you mostly think of yourself as someone that writes C (or C++, C#,~ +** Processing line: ~Objective-C), PHP, or Java, then you're only a step behind me right~ +** Processing line: ~now.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~** Prerequisites~ +- Header detected. +*** True Line Result + +*** True Line Result +** Prerequisites +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Here's the most important thing you should know: Ruby lets you do some~ +** Processing line: ~complicated things really easily, and you can learn that stuff~ +** Processing line: ~later. I'm going to show you one or two cool tricks, but that's all.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~Do you know what an if statement is? A for-loop? An array? That's all~ +** Processing line: ~you'll need to start.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Do you know what an if statement is? A for-loop? An array? That's all you'll need to start. +** Processing line: ~** The Game Loop~ +- Header detected. +*** True Line Result + +*** True Line Result +** The Game Loop +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Ok, here are few rules with regards to game development with GTK:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Ok, here are few rules with regards to game development with GTK: +** Processing line: ~- Your game is all going to happen under one function ...~ +- Line was identified as a list. +*** True Line Result + +** Processing line: ~- that runs 60 times a second ...~ +- Line was identified as a list. +*** True Line Result +- Your game is all going to happen under one function ... +** Processing line: ~- and has to tell the computer what to draw each time.~ +- Line was identified as a list. +*** True Line Result +- that runs 60 times a second ... +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +- and has to tell the computer what to draw each time. +** Processing line: ~That's an entire video game in one run-on sentence.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +That's an entire video game in one run-on sentence. +** Processing line: ~Here's that function. You're going to want to put this in~ +** Processing line: ~mygame/app/main.rb, because that's where we'll look for it by~ +** Processing line: ~default. Load it up in your favorite text editor.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** 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: ~ args.outputs.labels << [580, 400, 'Hello World!']~ +- Inside source: true +*** True Line Result + args.outputs.labels << [580, 400, 'Hello World!'] +** 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: ~Now run ~dragonruby~ ...did you get a window with "Hello World!"~ +** Processing line: ~written in it? Good, you're officially a game developer!~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Now run ~dragonruby~ ...did you get a window with "Hello World!" written in it? Good, you're officially a game developer! +** Processing line: ~** Breakdown Of The ~tick~ Method~ +- Header detected. +*** True Line Result + +*** True Line Result +** Breakdown Of The ~tick~ Method +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~~mygame/app/main.rb~, is where the Ruby source code is located. This~ +** Processing line: ~looks a little strange, so I'll break it down line by line. In Ruby, a~ +** Processing line: ~'#' character starts a single-line comment, so I'll talk about this~ +** Processing line: ~inline.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +~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. +** 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: ~ # This "def"ines a function, named "tick," which takes a single argument~ +- Inside source: true +*** True Line Result + # 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~ +- Inside source: true +*** True Line Result + # 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~ +- Inside source: true +*** True Line Result + # 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,~ +- Inside source: true +*** True Line Result + # 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,~ +- Inside source: true +*** True Line Result + # and every frame it will updated if keys are pressed, joysticks moved, +** Processing line: ~ # mice clicked, etc.~ +- Inside source: true +*** True Line Result + # mice clicked, etc. +** Processing line: ~ def tick args~ +- Inside source: true +*** True Line Result + def tick args +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # One of the things in "args" is the "outputs" object that your game uses~ +- Inside source: true +*** True Line Result + # 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,~ +- Inside source: true +*** True Line Result + # 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.~ +- Inside source: true +*** True Line Result + # 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~ +- Inside source: true +*** True Line Result + # 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.~ +- Inside source: true +*** True Line Result + # 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~ +- Inside source: true +*** True Line Result + # The "<<" thing says "append this array onto the list of them at +** Processing line: ~ # args.outputs.labels)~ +- Inside source: true +*** True Line Result + # args.outputs.labels) +** Processing line: ~ args.outputs.labels << [580, 400, 'Hello World!']~ +- Inside source: true +*** True Line Result + args.outputs.labels << [580, 400, 'Hello World!'] +** 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: ~Once your ~tick~ function finishes, we look at all the arrays you made~ +** Processing line: ~and figure out how to draw it. You don't need to know about graphics~ +** Processing line: ~APIs. You're just setting up some arrays! DragonRuby clears out these~ +** Processing line: ~arrays every frame, so you just need to add what you need _right now_~ +** Processing line: ~each time.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~** Rendering A Sprite~ +- Header detected. +*** True Line Result + +*** True Line Result +** Rendering A Sprite +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Now let's spice this up a little.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Now let's spice this up a little. +** Processing line: ~We're going to add some graphics. Each 2D image in DragonRuby is~ +** Processing line: ~called a "sprite," and to use them, you just make sure they exist in a~ +** Processing line: ~reasonable file format (png, jpg, gif, bmp, etc) and specify them by~ +** Processing line: ~filename. The first time you use one, DragonRuby will load it and keep~ +** Processing line: ~it in video memory for fast access in the future. If you use a~ +** Processing line: ~filename that doesn't exist, you get a fun checkerboard pattern!~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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! +** Processing line: ~There's a "dragonruby.png" file included, just to get you~ +** Processing line: ~started. Let's have it draw every frame with our text:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +There's a "dragonruby.png" file included, just to get you started. Let's have it draw every frame with our text: +** 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: ~ args.outputs.labels << [580, 400, 'Hello World!']~ +- Inside source: true +*** True Line Result + args.outputs.labels << [580, 400, 'Hello World!'] +** Processing line: ~ args.outputs.sprites << [576, 100, 128, 101, 'dragonruby.png']~ +- Inside source: true +*** True Line Result + args.outputs.sprites << [576, 100, 128, 101, 'dragonruby.png'] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~(Pro Tip: you don't have to restart DragonRuby to test your changes;~ +** Processing line: ~when you save main.rb, DragonRuby will notice and reload your~ +** Processing line: ~program.)~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +(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.) +** Processing line: ~That ~.sprites~ line says "add a sprite to the list of sprites we're~ +** Processing line: ~drawing, and draw it at position (576, 100) at a size of 128x101~ +** Processing line: ~pixels". You can find the image to draw at dragonruby.png.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~** Coordinate System and Virtual Canvas~ +- Header detected. +*** True Line Result + +*** True Line Result +** Coordinate System and Virtual Canvas +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Quick note about coordinates: (0, 0) is the bottom left corner of the~ +** Processing line: ~screen, and positive numbers go up and to the right. This is more~ +** Processing line: ~"geometrically correct," even if it's not how you remember doing 2D~ +** Processing line: ~graphics, but we chose this for a simpler reason: when you're making~ +** Processing line: ~Super Mario Brothers and you want Mario to jump, you should be able to~ +** Processing line: ~add to Mario's y position as he goes up and subtract as he falls. It~ +** Processing line: ~makes things easier to understand.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~Also: your game screen is _always_ 1280x720 pixels. If you resize the~ +** Processing line: ~window, we will scale and letterbox everything appropriately, so you~ +** Processing line: ~never have to worry about different resolutions.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~Ok, now we have an image on the screen, let's animate it:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Ok, now we have an image on the screen, let's animate it: +** 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: ~ args.state.rotation ||= 0~ +- Inside source: true +*** True Line Result + args.state.rotation ||= 0 +** Processing line: ~ args.outputs.labels << [580, 400, 'Hello World!' ]~ +- Inside source: true +*** True Line Result + args.outputs.labels << [580, 400, 'Hello World!' ] +** Processing line: ~ args.outputs.sprites << [576, 100, 128, 101, 'dragonruby.png', args.state.rotation]~ +- Inside source: true +*** True Line Result + args.outputs.sprites << [576, 100, 128, 101, 'dragonruby.png', args.state.rotation] +** Processing line: ~ args.state.rotation -= 1~ +- Inside source: true +*** True Line Result + args.state.rotation -= 1 +** 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: ~Now you can see that this function is getting called a lot!~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Now you can see that this function is getting called a lot! +** Processing line: ~** Game State~ +- Header detected. +*** True Line Result + +*** True Line Result +** Game State +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Here's a fun Ruby thing: ~args.state.rotation ||= 0~ is shorthand for~ +** Processing line: ~"if args.state.rotation isn't initialized, set it to zero." It's a~ +** Processing line: ~nice way to embed your initialization code right next to where you~ +** Processing line: ~need the variable.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~~args.state~ is a place you can hang your own data and have it survive~ +** Processing line: ~past the life of the function call. In this case, the current rotation~ +** Processing line: ~of our sprite, which is happily spinning at 60 frames per second. If~ +** Processing line: ~you don't specify rotation (or alpha, or color modulation, or a source~ +** Processing line: ~rectangle, etc), DragonRuby picks a reasonable default, and the array~ +** Processing line: ~is ordered by the most likely things you need to tell us: position,~ +** Processing line: ~size, name.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +~args.state~ is a place you can hang your own data and have it survive past the life of the function call. 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. +** Processing line: ~** There Is No Delta Time~ +- Header detected. +*** True Line Result + +*** True Line Result +** There Is No Delta Time +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~One thing we decided to do in DragonRuby is not make you worry about~ +** Processing line: ~delta time: your function runs at 60 frames per second (about 16~ +** Processing line: ~milliseconds) and that's that. Having to worry about framerate is~ +** Processing line: ~something massive triple-AAA games do, but for fun little 2D games?~ +** Processing line: ~You'd have to work really hard to not hit 60fps. All your drawing is~ +** Processing line: ~happening on a GPU designed to run Fortnite quickly; it can definitely~ +** Processing line: ~handle this.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~Since we didn't make you worry about delta time, you can just move the~ +** Processing line: ~rotation by 1 every time and it works without you having to keep track~ +** Processing line: ~of time and math. Want it to move faster? Subtract 2.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~** Handling User Input~ +- Header detected. +*** True Line Result + +*** True Line Result +** Handling User Input +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Now, let's move that image around.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Now, let's move that image around. +** 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: ~ args.state.rotation ||= 0~ +- Inside source: true +*** True Line Result + args.state.rotation ||= 0 +** Processing line: ~ args.state.x ||= 576~ +- Inside source: true +*** True Line Result + args.state.x ||= 576 +** Processing line: ~ args.state.y ||= 100~ +- Inside source: true +*** True Line Result + args.state.y ||= 100 +** 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: ~ args.state.x = args.inputs.mouse.click.point.x - 64~ +- Inside source: true +*** True Line Result + args.state.x = args.inputs.mouse.click.point.x - 64 +** Processing line: ~ args.state.y = args.inputs.mouse.click.point.y - 50~ +- Inside source: true +*** True Line Result + args.state.y = args.inputs.mouse.click.point.y - 50 +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ args.outputs.labels << [580, 400, 'Hello World!']~ +- Inside source: true +*** True Line Result + args.outputs.labels << [580, 400, 'Hello World!'] +** Processing line: ~ args.outputs.sprites << [args.state.x,~ +- Inside source: true +*** True Line Result + args.outputs.sprites << [args.state.x, +** Processing line: ~ args.state.y,~ +- Inside source: true +*** True Line Result + args.state.y, +** Processing line: ~ 128,~ +- Inside source: true +*** True Line Result + 128, +** Processing line: ~ 101,~ +- Inside source: true +*** True Line Result + 101, +** Processing line: ~ 'dragonruby.png',~ +- Inside source: true +*** True Line Result + 'dragonruby.png', +** Processing line: ~ args.state.rotation]~ +- Inside source: true +*** True Line Result + args.state.rotation] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ args.state.rotation -= 1~ +- Inside source: true +*** True Line Result + args.state.rotation -= 1 +** 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: ~Everywhere you click your mouse, the image moves there. We set a~ +** Processing line: ~default location for it with ~args.state.x ||= 576~, and then we~ +** Processing line: ~change those variables when we see the mouse button in action. You can~ +** Processing line: ~get at the keyboard and game controllers in similar ways.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~** Coding On A Raspberry Pi~ +- Header detected. +*** True Line Result + +*** True Line Result +** Coding On A Raspberry Pi +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~We have only tested DragonRuby on a Raspberry Pi 3, Models B and B+, but we~ +** Processing line: ~believe it _should_ work on any model with comparable specs.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~If you're running DragonRuby Game Toolkit on a Raspberry Pi, or trying to run~ +** Processing line: ~a game made with the Toolkit on a Raspberry Pi, and it's really really slow--~ +** Processing line: ~like one frame every few seconds--then there's likely a simple fix.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~You're probably running a desktop environment: menus, apps, web browsers,~ +** Processing line: ~etc. This is okay! Launch the terminal app and type:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +You're probably running a desktop environment: menus, apps, web browsers, etc. This is okay! Launch the terminal app and type: +** Processing line: ~#+begin_src~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src +** Processing line: ~sudo raspi-config~ +- Inside source: true +*** True Line Result +sudo raspi-config +** 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: ~It'll ask you for your password (if you don't know, try "raspberry"), and then~ +** Processing line: ~give you a menu of options. Find your way to "Advanced Options", then "GL~ +** Processing line: ~Driver", and change this to "GL (Full KMS)" ... not "fake KMS," which is~ +** Processing line: ~also listed there. Save and reboot. In theory, this should fix the problem.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~If you're _still_ having problems and have a Raspberry Pi 2 or better, go back~ +** Processing line: ~to raspi-config and head over to "Advanced Options", "Memory split," and give~ +** Processing line: ~the GPU 256 megabytes. You might be able to avoid this for simple games, as~ +** Processing line: ~this takes RAM away from the system and reserves it for graphics. You can~ +** Processing line: ~also try 128 megabytes as a gentler option.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~Note that you can also run DragonRuby without X11 at all: if you run it from~ +** Processing line: ~a virtual terminal it will render fullscreen and won't need the "Full KMS"~ +** Processing line: ~option. This might be attractive if you want to use it as a game console~ +** Processing line: ~sort of thing, or develop over ssh, or launch it from RetroPie, etc.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~** Conclusion~ +- Header detected. +*** True Line Result + +*** True Line Result +** Conclusion +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~There is a lot more you can do with DragonRuby, but now you've already~ +** Processing line: ~got just about everything you need to make a simple game. After all,~ +** Processing line: ~even the most fancy games are just creating objects and moving them~ +** Processing line: ~around. Experiment a little. Add a few more things and have them~ +** Processing line: ~interact in small ways. Want something to go away? Just don't add it~ +** Processing line: ~to ~args.output~ anymore.~ +** Processing line: ~~ +- 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!!~ +- Header detected. +*** True Line Result + +*** True Line Result +** IMPORTANT: Go Through All Of The Sample Apps! Study Them Thoroughly!! +** 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: ~1. 00_beginner_ruby_primer: This is an interactive tutorial that shows how to render ~solid~s, animated ~sprite~s, ~label~s.~ +- Line was identified as a start of a list. +*** True Line Result + +** Processing line: ~2. 00_intermediate_ruby_primer: This is a set of sample Ruby snippets that give you a high level introduction to the programming language.~ +- Line was identified as a continuation of a list. +*** True Line Result +1. 00_beginner_ruby_primer: This is an interactive tutorial that shows how to render ~solid~s, animated ~sprite~s, ~label~s. +** Processing line: ~3. 01_api_01_labels: Various ways to render ~label~s.~ +- Line was identified as a continuation of a list. +*** True Line Result +2. 00_intermediate_ruby_primer: This is a set of sample Ruby snippets that give you a high level introduction to the programming language. +** Processing line: ~4. 01_api_02_lines: Various ways to render ~line~s.~ +- Line was identified as a continuation of a list. +*** True Line Result +3. 01_api_01_labels: Various ways to render ~label~s. +** Processing line: ~5. 01_api_03_rects: Sample app shows various ways to render ~solid~s and ~border~s.~ +- Line was identified as a continuation of a list. +*** True Line Result +4. 01_api_02_lines: Various ways to render ~line~s. +** Processing line: ~6. 01_api_04_sprites: Sample app shows various ways to render ~sprite~s.~ +- Line was identified as a continuation of a list. +*** True Line Result +5. 01_api_03_rects: Sample app shows various ways to render ~solid~s and ~border~s. +** Processing line: ~7. 01_api_05_keyboard: Hows how to get keyboard input from the user.~ +- Line was identified as a continuation of a list. +*** True Line Result +6. 01_api_04_sprites: Sample app shows various ways to render ~sprite~s. +** Processing line: ~8. 01_api_06_mouse: Hows how to get mouse mouse position.~ +- Line was identified as a continuation of a list. +*** True Line Result +7. 01_api_05_keyboard: Hows how to get keyboard input from the user. +** Processing line: ~9. 01_api_07_point_to_rect: How to get mouse input from the user and shows collision/hit detection.~ +- Line was identified as a continuation of a list. +*** True Line Result +8. 01_api_06_mouse: Hows how to get mouse mouse position. +** Processing line: ~10. 01_api_08_rect_to_rect: Hit detection/collision between two rectangles.~ +- Line was identified as a continuation of a list. +*** True Line Result +9. 01_api_07_point_to_rect: How to get mouse input from the user and shows collision/hit detection. +** Processing line: ~11. 01_api_10_controller: Interaction with a USB/Bluetooth controller.~ +- Line was identified as a continuation of a list. +*** True Line Result +10. 01_api_08_rect_to_rect: Hit detection/collision between two rectangles. +** Processing line: ~12. 01_api_99_tech_demo: All the different render primitives along with using ~render_targets~.~ +- Line was identified as a continuation of a list. +*** True Line Result +11. 01_api_10_controller: Interaction with a USB/Bluetooth controller. +** Processing line: ~13. 02_collision_01_simple: Collision detection with dynamically moving bodies.~ +- Line was identified as a continuation of a list. +*** True Line Result +12. 01_api_99_tech_demo: All the different render primitives along with using ~render_targets~. +** Processing line: ~14. 02_collision_02_moving_objects: Collision detection between many primitives, simple platformer physics, and keyboard input.~ +- Line was identified as a continuation of a list. +*** True Line Result +13. 02_collision_01_simple: Collision detection with dynamically moving bodies. +** Processing line: ~15. 02_collision_03_entities: Collision with entities and serves as a small introduction to ECS (entity component system).~ +- Line was identified as a continuation of a list. +*** True Line Result +14. 02_collision_02_moving_objects: Collision detection between many primitives, simple platformer physics, and keyboard input. +** Processing line: ~16. 02_collision_04_ramp_with_debugging: How ramp trajectory can be calculated.~ +- Line was identified as a continuation of a list. +*** True Line Result +15. 02_collision_03_entities: Collision with entities and serves as a small introduction to ECS (entity component system). +** Processing line: ~17. 02_collision_05_ramp_with_debugging_two: How ramp trajectory can be calculated.~ +- Line was identified as a continuation of a list. +*** True Line Result +16. 02_collision_04_ramp_with_debugging: How ramp trajectory can be calculated. +** Processing line: ~18. 02_sprite_animation_and_keyboard_input: How to animate a sprite based off of keyboard input.~ +- Line was identified as a continuation of a list. +*** True Line Result +17. 02_collision_05_ramp_with_debugging_two: How ramp trajectory can be calculated. +** Processing line: ~19. 03_mouse_click: How to determine what direction/vector a mouse was clicked relative to a player.~ +- Line was identified as a continuation of a list. +*** True Line Result +18. 02_sprite_animation_and_keyboard_input: How to animate a sprite based off of keyboard input. +** Processing line: ~20. 04_sounds: How to play sounds and work with buttons.~ +- Line was identified as a continuation of a list. +*** True Line Result +19. 03_mouse_click: How to determine what direction/vector a mouse was clicked relative to a player. +** Processing line: ~21. 05_mouse_move: How to determine what direction/vector a mouse was clicked relative to a player.~ +- Line was identified as a continuation of a list. +*** True Line Result +20. 04_sounds: How to play sounds and work with buttons. +** Processing line: ~22. 05_mouse_move_paint_app: Represents a simple paint app.~ +- Line was identified as a continuation of a list. +*** True Line Result +21. 05_mouse_move: How to determine what direction/vector a mouse was clicked relative to a player. +** Processing line: ~23. 05_mouse_move_tile_editor: A starting point for a tile editor.~ +- Line was identified as a continuation of a list. +*** True Line Result +22. 05_mouse_move_paint_app: Represents a simple paint app. +** Processing line: ~24. 06_coordinate_systems: Shows the two origin systems within Game Toolkit where the origin is in the center and where the origin is at the bottom left.~ +- Line was identified as a continuation of a list. +*** True Line Result +23. 05_mouse_move_tile_editor: A starting point for a tile editor. +** Processing line: ~25. 07_render_targets: Shows a powerful concept called ~render_target~s. You can use this to programatically create sprites (it's also useful for representing parts of a scene as if it was a view port/camera).~ +- Line was identified as a continuation of a list. +*** True Line Result +24. 06_coordinate_systems: Shows the two origin systems within Game Toolkit where the origin is in the center and where the origin is at the bottom left. +** Processing line: ~26. 07_render_targets_advanced: Advanced usage of ~render_target~s.~ +- Line was identified as a continuation of a list. +*** True Line Result +25. 07_render_targets: Shows a powerful concept called ~render_target~s. You can use this to programatically create sprites (it's also useful for representing parts of a scene as if it was a view port/camera). +** Processing line: ~27. 08_platformer_collisions: Axis aligned collision along with platformer physics.~ +- Line was identified as a continuation of a list. +*** True Line Result +26. 07_render_targets_advanced: Advanced usage of ~render_target~s. +** Processing line: ~28. 08_platformer_collisions_metroidvania: How to save map data and place sprites live within a game.~ +- Line was identified as a continuation of a list. +*** True Line Result +27. 08_platformer_collisions: Axis aligned collision along with platformer physics. +** Processing line: ~29. 08_platformer_jumping_inertia: Jump physics and how inertia affects collision.~ +- Line was identified as a continuation of a list. +*** True Line Result +28. 08_platformer_collisions_metroidvania: How to save map data and place sprites live within a game. +** Processing line: ~30. 09_controller_analog_usage_advanced_sprites: Extended properties of a ~sprite~ and how to change the rotation anchor point and render a subset/tile of a sprite.~ +- Line was identified as a continuation of a list. +*** True Line Result +29. 08_platformer_jumping_inertia: Jump physics and how inertia affects collision. +** Processing line: ~31. 09_sprite_animation_using_tile_sheet: How to perform sprite animates using a tile sheet.~ +- Line was identified as a continuation of a list. +*** True Line Result +30. 09_controller_analog_usage_advanced_sprites: Extended properties of a ~sprite~ and how to change the rotation anchor point and render a subset/tile of a sprite. +** Processing line: ~32. 10_save_load_game: Save and load game data.~ +- Line was identified as a continuation of a list. +*** True Line Result +31. 09_sprite_animation_using_tile_sheet: How to perform sprite animates using a tile sheet. +** Processing line: ~33. 11_coersion_of_primitives: How primitives of one specific type can be rendered as another primitive type.~ +- Line was identified as a continuation of a list. +*** True Line Result +32. 10_save_load_game: Save and load game data. +** Processing line: ~34. 11_hash_primitives: How primitives can be represented using a ~Hash~.~ +- Line was identified as a continuation of a list. +*** True Line Result +33. 11_coersion_of_primitives: How primitives of one specific type can be rendered as another primitive type. +** Processing line: ~35. 12_controller_input_sprite_sheet_animations: How to leverage vectors to move a player around the screen.~ +- Line was identified as a continuation of a list. +*** True Line Result +34. 11_hash_primitives: How primitives can be represented using a ~Hash~. +** Processing line: ~36. 12_top_down_area: How to render a top down map and how to manage collision of a player.~ +- Line was identified as a continuation of a list. +*** True Line Result +35. 12_controller_input_sprite_sheet_animations: How to leverage vectors to move a player around the screen. +** Processing line: ~37. 13_01_easing_functions: How to use lerping functions to define animations/movement.~ +- Line was identified as a continuation of a list. +*** True Line Result +36. 12_top_down_area: How to render a top down map and how to manage collision of a player. +** Processing line: ~38. 13_02_cubic_bezier: How to create a bezier curve using lines.~ +- Line was identified as a continuation of a list. +*** True Line Result +37. 13_01_easing_functions: How to use lerping functions to define animations/movement. +** Processing line: ~39. 13_03_easing_using_spline: How a collection of bezier curves can be used to define an animation.~ +- Line was identified as a continuation of a list. +*** True Line Result +38. 13_02_cubic_bezier: How to create a bezier curve using lines. +** Processing line: ~40. 13_04_parametric_enemy_movement: How to define the movement of enemies and projectiles using lerping/parametric functions.~ +- Line was identified as a continuation of a list. +*** True Line Result +39. 13_03_easing_using_spline: How a collection of bezier curves can be used to define an animation. +** Processing line: ~41. 14_sprite_limits: Upper limit for how many sprites can be rendered to the screen.~ +- Line was identified as a continuation of a list. +*** True Line Result +40. 13_04_parametric_enemy_movement: How to define the movement of enemies and projectiles using lerping/parametric functions. +** Processing line: ~42. 14_sprite_limits_static_references: Upper limit for how many sprites can be rendered to the screen using ~static~ output collections (which are updated by reference as opposed to by value).~ +- Line was identified as a continuation of a list. +*** True Line Result +41. 14_sprite_limits: Upper limit for how many sprites can be rendered to the screen. +** Processing line: ~43. 15_collision_limits: How many collisions can be processed across many primitives.~ +- Line was identified as a continuation of a list. +*** True Line Result +42. 14_sprite_limits_static_references: Upper limit for how many sprites can be rendered to the screen using ~static~ output collections (which are updated by reference as opposed to by value). +** Processing line: ~44. 18_moddable_game: How you can make a game where content is authored by the player (modding support).~ +- Line was identified as a continuation of a list. +*** True Line Result +43. 15_collision_limits: How many collisions can be processed across many primitives. +** Processing line: ~45. 19_lowrez_jam_01_hello_world: How to use ~render_targets~ to create a low resolution game.~ +- Line was identified as a continuation of a list. +*** True Line Result +44. 18_moddable_game: How you can make a game where content is authored by the player (modding support). +** Processing line: ~46. 19_lowrez_jam_02_buttons: How to use ~render_targets~ to create a low resolution game.~ +- Line was identified as a continuation of a list. +*** True Line Result +45. 19_lowrez_jam_01_hello_world: How to use ~render_targets~ to create a low resolution game. +** Processing line: ~47. 19_lowrez_jam_03_space_shooter: How to use ~render_targets~ to create a low resolution game.~ +- Line was identified as a continuation of a list. +*** True Line Result +46. 19_lowrez_jam_02_buttons: How to use ~render_targets~ to create a low resolution game. +** Processing line: ~48. 20_roguelike_starting_point: A starting point for a roguelike and explores concepts such as line of sight.~ +- Line was identified as a continuation of a list. +*** True Line Result +47. 19_lowrez_jam_03_space_shooter: How to use ~render_targets~ to create a low resolution game. +** Processing line: ~49. 20_roguelike_starting_point_two: A starting point for a roguelike where sprites are provided from a tile map/tile sheet.~ +- Line was identified as a continuation of a list. +*** True Line Result +48. 20_roguelike_starting_point: A starting point for a roguelike and explores concepts such as line of sight. +** Processing line: ~50. 21_mailbox_usage: How to do interprocess communication.~ +- Line was identified as a continuation of a list. +*** True Line Result +49. 20_roguelike_starting_point_two: A starting point for a roguelike where sprites are provided from a tile map/tile sheet. +** Processing line: ~51. 22_trace_debugging: Debugging techniques and tracing execution through your game.~ +- Line was identified as a continuation of a list. +*** True Line Result +50. 21_mailbox_usage: How to do interprocess communication. +** Processing line: ~52. 22_trace_debugging_classes: Debugging techniques and tracing execution through your game.~ +- Line was identified as a continuation of a list. +*** True Line Result +51. 22_trace_debugging: Debugging techniques and tracing execution through your game. +** Processing line: ~53. 23_hexagonal_grid: How to make a tactical grid/map made of hexagons.~ +- Line was identified as a continuation of a list. +*** True Line Result +52. 22_trace_debugging_classes: Debugging techniques and tracing execution through your game. +** Processing line: ~54. 23_isometric_grid: How to make a tactical grid/map made of isometric sprites.~ +- Line was identified as a continuation of a list. +*** True Line Result +53. 23_hexagonal_grid: How to make a tactical grid/map made of hexagons. +** Processing line: ~55. 24_http_example: How to make http requests.~ +- Line was identified as a continuation of a list. +*** True Line Result +54. 23_isometric_grid: How to make a tactical grid/map made of isometric sprites. +** Processing line: ~56. 25_3d_experiment_01_square: How to create 3D objects.~ +- Line was identified as a continuation of a list. +*** True Line Result +55. 24_http_example: How to make http requests. +** Processing line: ~57. 26_jam_craft: Starting point for crafting game. It also shows how to customize the mouse cursor.~ +- Line was identified as a continuation of a list. +*** True Line Result +56. 25_3d_experiment_01_square: How to create 3D objects. +** Processing line: ~58. 99_sample_game_basic_gorillas: Reference implementation of a full game. Topics covered: physics, keyboard input, collision, sprite animation.~ +- Line was identified as a continuation of a list. +*** True Line Result +57. 26_jam_craft: Starting point for crafting game. It also shows how to customize the mouse cursor. +** Processing line: ~59. 99_sample_game_clepto_frog: Reference implementation of a full game. Topics covered: camera control, spring/rope physics, scene orchestration.~ +- Line was identified as a continuation of a list. +*** True Line Result +58. 99_sample_game_basic_gorillas: Reference implementation of a full game. Topics covered: physics, keyboard input, collision, sprite animation. +** Processing line: ~60. 99_sample_game_dueling_starships: Reference implementation that shows local multiplayer. Topics covered: vectors, particles, friction, inertia.~ +- Line was identified as a continuation of a list. +*** True Line Result +59. 99_sample_game_clepto_frog: Reference implementation of a full game. Topics covered: camera control, spring/rope physics, scene orchestration. +** Processing line: ~61. 99_sample_game_flappy_dragon: Reference implementation that is a clone of Flappy Bird. Topics covered: scene orchestration, collision, sound, sprite animations, lerping.~ +- Line was identified as a continuation of a list. +*** True Line Result +60. 99_sample_game_dueling_starships: Reference implementation that shows local multiplayer. Topics covered: vectors, particles, friction, inertia. +** Processing line: ~62. 99_sample_game_pong: Reference implementation of pong.~ +- Line was identified as a continuation of a list. +*** True Line Result +61. 99_sample_game_flappy_dragon: Reference implementation that is a clone of Flappy Bird. Topics covered: scene orchestration, collision, sound, sprite animations, lerping. +** Processing line: ~63. 99_sample_game_return_of_serenity: Reference implementation of low resolution story based game.~ +- Line was identified as a continuation of a list. +*** True Line Result +62. 99_sample_game_pong: Reference implementation of pong. +** Processing line: ~64. 99_sample_game_the_little_probe: Reference implementation of a full game. Topics covered: Arbitrary collision detection, loading map data, bounce/ball physics.~ +- Line was identified as a continuation of a list. +*** True Line Result +63. 99_sample_game_return_of_serenity: Reference implementation of low resolution story based game. +** Processing line: ~65. 99_sample_nddnug_workshop: Reference implementation of a full game. Topics covered: vectors, controller input, sound, trig functions.~ +- Line was identified as a continuation of a list. +*** True Line Result +64. 99_sample_game_the_little_probe: Reference implementation of a full game. Topics covered: Arbitrary collision detection, loading map data, bounce/ball physics. +** Processing line: ~66. 99_sample_snakemoji: Shows that Ruby supports coding with emojis.~ +- Line was identified as a continuation of a list. +*** True Line Result +65. 99_sample_nddnug_workshop: Reference implementation of a full game. Topics covered: vectors, controller input, sound, trig functions. +** Processing line: ~67. 99_zz_gtk_unit_tests: A collection of unit tests that exercise parts of DragonRuby's API.~ +- Line was identified as a continuation of a list. +*** True Line Result +66. 99_sample_snakemoji: Shows that Ruby supports coding with emojis. +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +67. 99_zz_gtk_unit_tests: A collection of unit tests that exercise parts of DragonRuby's API. +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~* Deploying To Itch.io~ +- Header detected. +*** True Line Result + +*** True Line Result +* Deploying To Itch.io +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Once you've built your game, you're all set to deploy! Good luck in~ +** Processing line: ~your game dev journey and if you get stuck, come to the Discord~ +** Processing line: ~channel!~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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! +** Processing line: ~** Creating Your Game Landing Page~ +- Header detected. +*** True Line Result + +*** True Line Result +** Creating Your Game Landing Page +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Log into Itch.io and go to [[https://itch.io/game/new]].~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Log into Itch.io and go to [[https://itch.io/game/new]]. +** Processing line: ~- Title: Give your game a Title. This value represents your `gametitle`.~ +- Line was identified as a list. +*** True Line Result + +** Processing line: ~- Project URL: Set your project url. This value represents your `gameid`.~ +- Line was identified as a list. +*** True Line Result +- Title: Give your game a Title. This value represents your `gametitle`. +** Processing line: ~- Classification: Keep this as Game.~ +- Line was identified as a list. +*** True Line Result +- Project URL: Set your project url. This value represents your `gameid`. +** Processing line: ~- Kind of Project: Select HTML from the drop down list. Don't worry,~ +- Line was identified as a list. +*** True Line Result +- Classification: Keep this as Game. +** Processing line: ~ the HTML project type _also supports binary downloads_.~ +** Processing line: ~- Uploads: Skip this section for now.~ +- Line was identified as a list. +*** True Line Result +- Kind of Project: Select HTML from the drop down list. Don't worry, + the HTML project type _also supports binary downloads_. +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +- Uploads: Skip this section for now. +** Processing line: ~You can fill out all the other options later.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +You can fill out all the other options later. +** Processing line: ~** Update Your Game's Metadata~ +- Header detected. +*** True Line Result + +*** True Line Result +** Update Your Game's Metadata +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Point your text editor at mygame/metadata/game_metadata.txt and~ +** Processing line: ~make it look like this:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Point your text editor at mygame/metadata/game_metadata.txt and make it look like this: +** Processing line: ~NOTE: Remove the ~#~ at the beginning of each line.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +NOTE: Remove the ~#~ at the beginning of each line. +** Processing line: ~#+begin_src~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src +** Processing line: ~devid=bob~ +- Inside source: true +*** True Line Result +devid=bob +** Processing line: ~devtitle=Bob The Game Developer~ +- Inside source: true +*** True Line Result +devtitle=Bob The Game Developer +** 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: ~#+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: ~The ~devid~ property is the username you use to log into Itch.io.~ +** Processing line: ~The ~devtitle~ is your name or company name (it can contain spaces).~ +** Processing line: ~The ~gameid~ is the Project URL value.~ +** Processing line: ~The ~gametitle~ is the name of your game (it can contain spaces).~ +** Processing line: ~The ~version~ can be any ~major.minor~ number format.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~** Building Your Game For Distribution~ +- Header detected. +*** True Line Result + +*** True Line Result +** Building Your Game For Distribution +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Open up the terminal and run this from the command line:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Open up the terminal and run this from the command line: +** Processing line: ~#+begin_src~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src +** Processing line: ~./dragonruby-publish --only-package mygame~ +- Inside source: true +*** True Line Result +./dragonruby-publish --only-package mygame +** 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: ~(if you're on Windows, don't put the "./" on the front. That's a Mac and~ +** Processing line: ~Linux thing.)~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +(if you're on Windows, don't put the "./" on the front. That's a Mac and Linux thing.) +** Processing line: ~A directory called ~./build~ will be created that contains your~ +** Processing line: ~binaries. You can upload this to Itch.io manually.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +A directory called ~./build~ will be created that contains your binaries. You can upload this to Itch.io manually. +** Processing line: ~For the HTML version of your game after you upload it. Check the checkbox labeled~ +** Processing line: ~"This file will be played in the browser".~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +For the HTML version of your game after you upload it. Check the checkbox labeled "This file will be played in the browser". +** Processing line: ~For subsequent updates you can use an automated deployment to Itch.io:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +For subsequent updates you can use an automated deployment to Itch.io: +** Processing line: ~#+begin_src~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src +** Processing line: ~./dragonruby-publish mygame~ +- Inside source: true +*** True Line Result +./dragonruby-publish mygame +** 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: ~DragonRuby will package _and publish_ your game to itch.io! Tell your~ +** Processing line: ~friends to go to your game's very own webpage and buy it!~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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! +** Processing line: ~If you make changes to your game, just re-run dragonruby-publish and it'll~ +** Processing line: ~update the downloads for you.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +If you make changes to your game, just re-run dragonruby-publish and it'll update the downloads for you. +** Processing line: ~** DragonRuby's Philosophy~ +- Header detected. +*** True Line Result + +*** True Line Result +** DragonRuby's Philosophy +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~The following tenants of DragonRuby are what set us apart from other~ +** Processing line: ~game engines. Given that Game Toolkit is a relatively new engine,~ +** Processing line: ~there are definitely features that are missing. So having a big check~ +** Processing line: ~list of "all the cool things" is not this engine's forte. This is~ +** Processing line: ~compensated with a strong commitment to the following principals.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +The following tenants of DragonRuby are what set us apart from other game engines. Given that Game Toolkit is a relatively new engine, there are definitely features that are missing. So having a big check list of "all the cool things" is not this engine's forte. This is compensated with a strong commitment to the following principals. +** Processing line: ~*** Challenge The Status Quo~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Challenge The Status Quo +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Game engines of today are in a local maximum and don't take into~ +** Processing line: ~consideration the challenges of this day and age. Unity and GameMaker~ +** Processing line: ~specifically rot your brain. It's not sufficient to say:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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: +** Processing line: ~#+begin_quote~ +- Line was identified as a literal block. +*** True Line Result + +*** True Line Result +#+begin_quote +** Processing line: ~But that's how we've always done it.~ +** Processing line: ~#+end_quote~ +- Line was identified as a literal block. +*** True Line Result +But that's how we've always done it. +*** True Line Result +#+end_quote +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~It's a hard pill to swallow, but forget blindly accepted best~ +** Processing line: ~practices and try to figure out the underlying motivation for a~ +** Processing line: ~specific approach to game development. Collaborate with us.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~*** Release Often And Quickly~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Release Often And Quickly +** 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: ~~ +- 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. +** 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.~ +** Processing line: ~You'll find a lot of support and encouragement there.~ +** Processing line: ~~ +- 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: ~~ +- 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 + +** Processing line: ~*** Sustainable And Ethical Monetization~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Sustainable And Ethical Monetization +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~We all aspire to put food on the table doing what we love. Whether it~ +** Processing line: ~is building games, writing tools to support game development, or~ +** Processing line: ~anything in between.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~Charge a fair amount of money for the things you create. It's expected~ +** Processing line: ~and encouraged within the community. Give what you create away for~ +** Processing line: ~free to those that can't afford it.~ +** Processing line: ~~ +- 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: ~*** Sustainable And Ethical Open Source~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Sustainable And Ethical Open Source +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~This goes hand in hand with sustainable and ethical monetization. The~ +** Processing line: ~current state of open source is not sustainable. There is an immense~ +** Processing line: ~amount of contributor burnout. Users of open source expect everything~ +** Processing line: ~to be free, and few give back. This is a problem we want to fix (we're~ +** Processing line: ~still trying to figure out the best solution).~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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). +** Processing line: ~So, don't be "that guy" in the Discord that says "DragonRuby should be~ +** Processing line: ~free and open source!" You will be personally flogged by Amir.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~*** People Over Entities~ +- Header detected. +*** True Line Result + +*** True Line Result +*** People Over Entities +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~We prioritize the endorsement of real people over faceless~ +** Processing line: ~entities. This game engine, and other products we create, are not~ +** Processing line: ~insignificant line items of a large company. And you aren't a generic~ +** Processing line: ~"commodity" or "corporate resource". So be active in the community~ +** Processing line: ~Discord and you'll reap the benefits as more devs use DragonRuby.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~*** Building A Game Should Be Fun And Bring Happiness~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Building A Game Should Be Fun And Bring Happiness +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~We will prioritize the removal of pain. The aesthetics of Ruby make it~ +** Processing line: ~such a joy to work with, and we want to capture that within the~ +** Processing line: ~engine.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~*** Real World Application Drives Features~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Real World Application Drives Features +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~We are bombarded by marketing speak day in and day out. We don't do~ +** Processing line: ~that here. There are things that are really great in the engine, and~ +** Processing line: ~things that need a lot of work. Collaborate with us so we can help you~ +** Processing line: ~reach your goals. Ask for features you actually need as opposed to~ +** Processing line: ~anything speculative.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~We want DragonRuby to *actually* help you build the game you~ +** Processing line: ~want to build (as opposed to sell you something piece of demoware that~ +** Processing line: ~doesn't work).~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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). +** 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 + +** Processing line: ~There is a property on ~state~ called ~tick_count~ that is incremented~ +** Processing line: ~by DragonRuby every time the ~tick~ method is called. The following~ +** Processing line: ~code renders a label that displays the current ~tick_count~.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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~. +** 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: ~ args.outputs.labels << [10, 670, "#{args.state.tick_count}"]~ +- Inside source: true +*** True Line Result + args.outputs.labels << [10, 670, "#{args.state.tick_count}"] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~* How To Get Current Framerate~ +- Header detected. +*** True Line Result + +*** True Line Result +* How To Get Current Framerate +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Current framerate is a top level property on the Game Toolkit Runtime~ +** Processing line: ~and is accessible via ~args.gtk.current_framerate~.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Current framerate is a top level property on the Game Toolkit Runtime and is accessible via ~args.gtk.current_framerate~. +** 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: ~ args.outputs.labels << [10, 710, "framerate: #{args.gtk.current_framerate.round}"]~ +- Inside source: true +*** True Line Result + args.outputs.labels << [10, 710, "framerate: #{args.gtk.current_framerate.round}"] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~* How To Render A Sprite Using An Array~ +- Header detected. +*** True Line Result + +*** True Line Result +* How To Render A Sprite Using An Array +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~All file paths should use the forward slash ~/~ *not* backslash~ +** Processing line: ~~~. Game Toolkit includes a number of sprites in the ~sprites~~ +** Processing line: ~folder (everything about your game is located in the ~mygame~ directory).~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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). +** Processing line: ~The following code renders a sprite with a ~width~ and ~height~ of~ +** Processing line: ~~100~ in the center of the screen.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +The following code renders a sprite with a ~width~ and ~height~ of ~100~ in the center of the screen. +** Processing line: ~~args.outputs.sprites~ is used to render a sprite.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +~args.outputs.sprites~ is used to render 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: ~ args.outputs.sprites << [~ +- Inside source: true +*** True Line Result + args.outputs.sprites << [ +** Processing line: ~ 640 - 50, # X~ +- Inside source: true +*** True Line Result + 640 - 50, # X +** Processing line: ~ 360 - 50, # Y~ +- Inside source: true +*** True Line Result + 360 - 50, # Y +** Processing line: ~ 100, # W~ +- Inside source: true +*** True Line Result + 100, # W +** Processing line: ~ 100, # H~ +- Inside source: true +*** True Line Result + 100, # H +** Processing line: ~ 'sprites/square-blue.png' # PATH~ +- Inside source: true +*** True Line Result + 'sprites/square-blue.png' # PATH +** 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: ~* More Sprite Properties As An Array~ +- Header detected. +*** True Line Result + +*** True Line Result +* More Sprite Properties As An Array +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Here are all the properties you can set on a sprite.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Here are all the properties you can set on 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: ~ args.outputs.sprites << [~ +- Inside source: true +*** True Line Result + args.outputs.sprites << [ +** Processing line: ~ 100, # X~ +- Inside source: true +*** True Line Result + 100, # X +** Processing line: ~ 100, # Y~ +- Inside source: true +*** True Line Result + 100, # Y +** Processing line: ~ 32, # W~ +- Inside source: true +*** True Line Result + 32, # W +** Processing line: ~ 64, # H~ +- Inside source: true +*** True Line Result + 64, # H +** Processing line: ~ 'sprites/square-blue.png', # PATH~ +- Inside source: true +*** True Line Result + 'sprites/square-blue.png', # PATH +** Processing line: ~ 0, # ANGLE~ +- Inside source: true +*** True Line Result + 0, # ANGLE +** Processing line: ~ 255, # ALPHA~ +- Inside source: true +*** True Line Result + 255, # ALPHA +** Processing line: ~ 0, # RED_SATURATION~ +- Inside source: true +*** True Line Result + 0, # RED_SATURATION +** Processing line: ~ 255, # GREEN_SATURATION~ +- Inside source: true +*** True Line Result + 255, # GREEN_SATURATION +** Processing line: ~ 0 # BLUE_SATURATION~ +- Inside source: true +*** True Line Result + 0 # BLUE_SATURATION +** 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: ~* Different Sprite Representations~ +- Header detected. +*** True Line Result + +*** True Line Result +* Different Sprite Representations +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Using ordinal positioning can get a little unruly given so many~ +** Processing line: ~properties you have control over.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Using ordinal positioning can get a little unruly given so many properties you have control over. +** Processing line: ~You can represent a sprite as a ~Hash~:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +You can represent a sprite as a ~Hash~: +** 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: ~ args.outputs.sprites << {~ +- Inside source: true +*** True Line Result + args.outputs.sprites << { +** Processing line: ~ x: 640 - 50,~ +- Inside source: true +*** True Line Result + x: 640 - 50, +** Processing line: ~ y: 360 - 50,~ +- Inside source: true +*** True Line Result + y: 360 - 50, +** 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/square-blue.png',~ +- Inside source: true +*** True Line Result + path: 'sprites/square-blue.png', +** Processing line: ~ angle: 0,~ +- Inside source: true +*** True Line Result + angle: 0, +** Processing line: ~ a: 255,~ +- Inside source: true +*** True Line Result + a: 255, +** Processing line: ~ r: 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: ~ source_x: 0,~ +- Inside source: true +*** True Line Result + source_x: 0, +** Processing line: ~ source_y: 0,~ +- Inside source: true +*** True Line Result + source_y: 0, +** Processing line: ~ source_w: -1,~ +- Inside source: true +*** True Line Result + source_w: -1, +** Processing line: ~ source_h: -1,~ +- Inside source: true +*** True Line Result + source_h: -1, +** Processing line: ~ flip_vertically: false,~ +- Inside source: true +*** True Line Result + flip_vertically: false, +** Processing line: ~ flip_horizontally: false,~ +- Inside source: true +*** True Line Result + flip_horizontally: false, +** Processing line: ~ angle_anchor_x: 0.5,~ +- Inside source: true +*** True Line Result + angle_anchor_x: 0.5, +** Processing line: ~ angle_anchor_y: 1.0~ +- Inside source: true +*** True Line Result + angle_anchor_y: 1.0 +** Processing line: ~ }~ +- Inside source: true +*** True Line Result + } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~You can represent a sprite as an ~object~:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +You can represent a sprite as an ~object~: +** 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: ~ # Create type with ALL sprite properties AND primitive_marker~ +- Inside source: true +*** True Line Result + # Create type with ALL sprite properties AND primitive_marker +** Processing line: ~ class Sprite~ +- Inside source: true +*** True Line Result + class Sprite +** Processing line: ~ attr_accessor :x, :y, :w, :h, :path, :angle, :a, :r, :g, :b,~ +- Inside source: true +*** True Line Result + attr_accessor :x, :y, :w, :h, :path, :angle, :a, :r, :g, :b, +** 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: ~ :tile_x, :tile_y, :tile_w, :tile_h,~ +- Inside source: true +*** True Line Result + :tile_x, :tile_y, :tile_w, :tile_h, +** Processing line: ~ :flip_horizontally, :flip_vertically,~ +- Inside source: true +*** True Line Result + :flip_horizontally, :flip_vertically, +** Processing line: ~ :angle_anchor_x, :angle_anchor_y~ +- Inside source: true +*** True Line Result + :angle_anchor_x, :angle_anchor_y +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def primitive_marker~ +- Inside source: true +*** True Line Result + def primitive_marker +** Processing line: ~ :sprite~ +- Inside source: true +*** True Line Result + :sprite +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ class BlueSquare < Sprite~ +- Inside source: true +*** True Line Result + class BlueSquare < Sprite +** Processing line: ~ def initialize opts~ +- Inside source: true +*** True Line Result + def initialize opts +** Processing line: ~ @x = opts[:x]~ +- Inside source: true +*** True Line Result + @x = opts[:x] +** Processing line: ~ @y = opts[:y]~ +- Inside source: true +*** True Line Result + @y = opts[:y] +** Processing line: ~ @w = opts[:w]~ +- Inside source: true +*** True Line Result + @w = opts[:w] +** Processing line: ~ @h = opts[:h]~ +- Inside source: true +*** True Line Result + @h = opts[:h] +** Processing line: ~ @path = 'sprites/square-blue.png'~ +- Inside source: true +*** True Line Result + @path = 'sprites/square-blue.png' +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def tick args~ +- Inside source: true +*** True Line Result + def tick args +** Processing line: ~ args.outputs.sprites << (BlueSquare.new x: 640 - 50,~ +- Inside source: true +*** True Line Result + args.outputs.sprites << (BlueSquare.new x: 640 - 50, +** Processing line: ~ y: 360 - 50,~ +- Inside source: true +*** True Line Result + y: 360 - 50, +** Processing line: ~ w: 50,~ +- Inside source: true +*** True Line Result + w: 50, +** Processing line: ~ h: 50)~ +- Inside source: true +*** True Line Result + h: 50) +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~* How To Render A Label~ +- Header detected. +*** True Line Result + +*** True Line Result +* How To Render A Label +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~~args.outputs.labels~ is used to render labels.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +~args.outputs.labels~ is used to render labels. +** Processing line: ~Labels are how you display text. This code will go directly inside of~ +** Processing line: ~the ~def tick args~ method.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Labels are how you display text. This code will go directly inside of the ~def tick args~ method. +** Processing line: ~Here is the minimum code:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Here is the minimum code: +** Processing line: ~#+begin_src~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src +** Processing line: ~ def tick args~ +- Inside source: true +*** True Line Result + def tick args +** Processing line: ~ # X Y TEXT~ +- Inside source: true +*** True Line Result + # X Y TEXT +** Processing line: ~ args.outputs.labels << [640, 360, "I am a black label."]~ +- Inside source: true +*** True Line Result + args.outputs.labels << [640, 360, "I am a black label."] +** 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: ~* A Colored Label~ +- Header detected. +*** True Line Result + +*** True Line Result +* A Colored Label +** 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: ~ # A colored label~ +- Inside source: true +*** True Line Result + # A colored label +** Processing line: ~ # X Y TEXT, RED GREEN BLUE ALPHA~ +- Inside source: true +*** True Line Result + # X Y TEXT, RED GREEN BLUE ALPHA +** Processing line: ~ args.outputs.labels << [640, 360, "I am a redish label.", 255, 128, 128, 255]~ +- Inside source: true +*** True Line Result + args.outputs.labels << [640, 360, "I am a redish label.", 255, 128, 128, 255] +** 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: ~* Extended Label Properties~ +- Header detected. +*** True Line Result + +*** True Line Result +* Extended Label Properties +** 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: ~ # A colored label~ +- Inside source: true +*** True Line Result + # A colored label +** Processing line: ~ # X Y TEXT SIZE ALIGNMENT RED GREEN BLUE ALPHA FONT FILE~ +- Inside source: true +*** True Line Result + # X Y TEXT SIZE ALIGNMENT RED GREEN BLUE ALPHA FONT FILE +** Processing line: ~ args.outputs.labels << [~ +- Inside source: true +*** True Line Result + args.outputs.labels << [ +** Processing line: ~ 640, # X~ +- Inside source: true +*** True Line Result + 640, # X +** Processing line: ~ 360, # Y~ +- Inside source: true +*** True Line Result + 360, # Y +** Processing line: ~ "Hello world", # TEXT~ +- Inside source: true +*** True Line Result + "Hello world", # TEXT +** Processing line: ~ 0, # SIZE_ENUM~ +- Inside source: true +*** True Line Result + 0, # SIZE_ENUM +** Processing line: ~ 1, # ALIGNMENT_ENUM~ +- Inside source: true +*** True Line Result + 1, # ALIGNMENT_ENUM +** Processing line: ~ 0, # RED~ +- Inside source: true +*** True Line Result + 0, # RED +** Processing line: ~ 0, # GREEN~ +- Inside source: true +*** True Line Result + 0, # GREEN +** Processing line: ~ 0, # BLUE~ +- Inside source: true +*** True Line Result + 0, # BLUE +** Processing line: ~ 255, # ALPHA~ +- Inside source: true +*** True Line Result + 255, # ALPHA +** Processing line: ~ "fonts/coolfont.ttf" # FONT~ +- Inside source: true +*** True Line Result + "fonts/coolfont.ttf" # FONT +** 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: ~A ~SIZE_ENUM~ of ~0~ represents "default size". A ~negative~ value~ +** Processing line: ~will decrease the label size. A ~positive~ value will increase the~ +** Processing line: ~label's size.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~An ~ALIGNMENT_ENUM~ of ~0~ represents "left aligned". ~1~ represents~ +** Processing line: ~"center aligned". ~2~ represents "right aligned".~ +** Processing line: ~~ +- 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: ~* Rendering A Label As A ~Hash~~ +- Header detected. +*** True Line Result + +*** True Line Result +* Rendering A Label As A ~Hash~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~You can add additional metadata about your game within a label, which requires you to use a `Hash` instead.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +You can add additional metadata about your game within a label, which requires you to use a `Hash` instead. +** Processing line: ~#+begin_src~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src +** Processing line: ~ def tick args~ +- Inside source: true +*** True Line Result + def tick args +** Processing line: ~ args.outputs.labels << {~ +- Inside source: true +*** True Line Result + args.outputs.labels << { +** Processing line: ~ x: 200,~ +- Inside source: true +*** True Line Result + x: 200, +** Processing line: ~ y: 550,~ +- Inside source: true +*** True Line Result + y: 550, +** Processing line: ~ text: "dragonruby",~ +- Inside source: true +*** True Line Result + text: "dragonruby", +** Processing line: ~ size_enum: 2,~ +- Inside source: true +*** True Line Result + size_enum: 2, +** Processing line: ~ alignment_enum: 1,~ +- Inside source: true +*** True Line Result + alignment_enum: 1, +** Processing line: ~ r: 155,~ +- Inside source: true +*** True Line Result + r: 155, +** 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,~ +- Inside source: true +*** True Line Result + a: 255, +** Processing line: ~ font: "fonts/manaspc.ttf",~ +- Inside source: true +*** True Line Result + font: "fonts/manaspc.ttf", +** Processing line: ~ # You can add any properties you like (this will be ignored/won't cause errors)~ +- Inside source: true +*** True Line Result + # You can add any properties you like (this will be ignored/won't cause errors) +** Processing line: ~ game_data_one: "Something",~ +- Inside source: true +*** True Line Result + game_data_one: "Something", +** Processing line: ~ game_data_two: {~ +- Inside source: true +*** True Line Result + game_data_two: { +** Processing line: ~ value_1: "value",~ +- Inside source: true +*** True Line Result + value_1: "value", +** Processing line: ~ value_2: "value two",~ +- Inside source: true +*** True Line Result + value_2: "value two", +** Processing line: ~ a_number: 15~ +- Inside source: true +*** True Line Result + a_number: 15 +** 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_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: ~* Getting The Size Of A Piece Of Text~ +- Header detected. +*** True Line Result + +*** True Line Result +* Getting The Size Of A Piece Of Text +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~You can get the render size of any string using ~args.gtk.calcstringbox~.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +You can get the render size of any string using ~args.gtk.calcstringbox~. +** 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: ~ # TEXT SIZE_ENUM FONT~ +- Inside source: true +*** True Line Result + # TEXT SIZE_ENUM FONT +** Processing line: ~ w, h = args.gtk.calcstringbox("some string", 0, "font.ttf")~ +- Inside source: true +*** True Line Result + w, h = args.gtk.calcstringbox("some string", 0, "font.ttf") +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # NOTE: The SIZE_ENUM and FONT are optional arguments.~ +- Inside source: true +*** True Line Result + # NOTE: The SIZE_ENUM and FONT are optional arguments. +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Render a label showing the w and h of the text:~ +- Inside source: true +*** True Line Result + # Render a label showing the w and h of the text: +** Processing line: ~ args.outputs.labels << [~ +- Inside source: true +*** True Line Result + args.outputs.labels << [ +** Processing line: ~ 10,~ +- Inside source: true +*** True Line Result + 10, +** Processing line: ~ 710,~ +- Inside source: true +*** True Line Result + 710, +** Processing line: ~ # This string uses Ruby's string interpolation literal: #{}~ +- Inside source: true +*** True Line Result + # This string uses Ruby's string interpolation literal: #{} +** Processing line: ~ "'some string' has width: #{w}, and height: #{h}."~ +- Inside source: true +*** True Line Result + "'some string' has width: #{w}, and height: #{h}." +** 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: ~* How To Play A Sound~ +- Header detected. +*** True Line Result + +*** True Line Result +* How To Play A Sound +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Sounds that end ~.wav~ will play once:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Sounds that end ~.wav~ will play once: +** 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: ~ # Play a sound every second~ +- Inside source: true +*** True Line Result + # Play a sound every second +** Processing line: ~ if (args.state.tick_count % 60) == 0~ +- Inside source: true +*** True Line Result + if (args.state.tick_count % 60) == 0 +** Processing line: ~ args.outputs.sounds << 'something.wav'~ +- Inside source: true +*** True Line Result + args.outputs.sounds << 'something.wav' +** 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: ~Sounds that end ~.ogg~ is considered background music and will loop:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Sounds that end ~.ogg~ is considered background music and will loop: +** 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 a sound loop at the beginning of the game~ +- Inside source: true +*** True Line Result + # Start a sound loop at the beginning of the game +** Processing line: ~ if args.state.tick_count == 0~ +- Inside source: true +*** True Line Result + if args.state.tick_count == 0 +** Processing line: ~ args.outputs.sounds << 'background_music.ogg'~ +- Inside source: true +*** True Line Result + args.outputs.sounds << 'background_music.ogg' +** 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: ~If you want to play a ~.ogg~ once as if it were a sound effect, you can do:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +If you want to play a ~.ogg~ once as if it were a sound effect, you can do: +** 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: ~ # Play a sound every second~ +- Inside source: true +*** True Line Result + # Play a sound every second +** Processing line: ~ if (args.state.tick_count % 60) == 0~ +- Inside source: true +*** True Line Result + if (args.state.tick_count % 60) == 0 +** Processing line: ~ args.gtk.queue_sound 'some-ogg.ogg'~ +- Inside source: true +*** True Line Result + args.gtk.queue_sound 'some-ogg.ogg' +** 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: ~* Using ~args.state~ To Store Your Game State~ +- Header detected. +*** True Line Result + +*** True Line Result +* Using ~args.state~ To Store Your Game State +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~~args.state~ is a open data structure that allows you to define~ +** Processing line: ~properties that are arbitrarily nested. You don't need to define any kind of~ +** Processing line: ~~class~.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +~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~. +** Processing line: ~To initialize your game state, use the ~||=~ operator. Any value on~ +** Processing line: ~the right side of ~||=~ will only be assigned _once_.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +To initialize your game state, use the ~||=~ operator. Any value on the right side of ~||=~ will only be assigned _once_. +** Processing line: ~To assign a value every frame, just use the ~=~ operator, but _make~ +** Processing line: ~sure_ you've initialized a default value.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +To assign a value every frame, just use the ~=~ operator, but _make sure_ you've initialized a default value. +** 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: ~ # initialize your game state ONCE~ +- Inside source: true +*** True Line Result + # initialize your game state ONCE +** Processing line: ~ args.player.x ||= 0~ +- Inside source: true +*** True Line Result + args.player.x ||= 0 +** Processing line: ~ args.player.y ||= 0~ +- Inside source: true +*** True Line Result + args.player.y ||= 0 +** Processing line: ~ args.player.hp ||= 100~ +- Inside source: true +*** True Line Result + args.player.hp ||= 100 +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # increment the x position of the character by one every frame~ +- Inside source: true +*** True Line Result + # increment the x position of the character by one every frame +** Processing line: ~ args.player.x += 1~ +- Inside source: true +*** True Line Result + args.player.x += 1 +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Render a sprite with a label above the sprite~ +- Inside source: true +*** True Line Result + # Render a sprite with a label above the sprite +** Processing line: ~ args.outputs.sprites << [~ +- Inside source: true +*** True Line Result + args.outputs.sprites << [ +** Processing line: ~ args.player.x,~ +- Inside source: true +*** True Line Result + args.player.x, +** Processing line: ~ args.player.y,~ +- Inside source: true +*** True Line Result + args.player.y, +** Processing line: ~ 32, 32,~ +- Inside source: true +*** True Line Result + 32, 32, +** Processing line: ~ "player.png"~ +- Inside source: true +*** True Line Result + "player.png" +** Processing line: ~ ]~ +- Inside source: true +*** True Line Result + ] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ args.outputs.labels << [~ +- Inside source: true +*** True Line Result + args.outputs.labels << [ +** Processing line: ~ args.player.x,~ +- Inside source: true +*** True Line Result + args.player.x, +** Processing line: ~ args.player.y - 50,~ +- Inside source: true +*** True Line Result + args.player.y - 50, +** Processing line: ~ args.player.hp~ +- Inside source: true +*** True Line Result + args.player.hp +** 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: ~* Frequently Asked Questions, Comments, and Concerns~ +- Header detected. +*** True Line Result + +*** True Line Result +* Frequently Asked Questions, Comments, and Concerns +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Here are questions, comments, and concerns that frequently come~ +** Processing line: ~up.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Here are questions, comments, and concerns that frequently come up. +** Processing line: ~** Frequently Asked Questions~ +- Header detected. +*** True Line Result + +*** True Line Result +** Frequently Asked Questions +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** What is DragonRuby LLP?~ +- Header detected. +*** True Line Result + +*** True Line Result +*** What is DragonRuby LLP? +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~DragonRuby LLP is a partnership of four devs who came together~ +** Processing line: ~with the goal of bringing the aesthetics and joy of Ruby, everywhere possible.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +DragonRuby LLP is a partnership of four devs who came together with the goal of bringing the aesthetics and joy of Ruby, everywhere possible. +** Processing line: ~Under DragonRuby LLP, we offer a number of products (with more on the~ +** Processing line: ~way):~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Under DragonRuby LLP, we offer a number of products (with more on the way): +** Processing line: ~- Game Toolkit (GTK): A 2D game engine that is compatible with modern~ +- Line was identified as a list. +*** True Line Result + +** Processing line: ~ gaming platforms. [Home Page]() [FAQ Page]()~ +** Processing line: ~- RubyMotion (RM): A compiler toolchain that allows you to build native, cross-platform mobile~ +- Line was identified as a list. +*** True Line Result +- Game Toolkit (GTK): A 2D game engine that is compatible with modern + gaming platforms. [Home Page]() [FAQ Page]() +** Processing line: ~ apps. [Home Page]() [FAQ Page]()~ +** Processing line: ~- Commandline Toolkit (CTK): A zero dependency, zero installation Ruby~ +- Line was identified as a list. +*** True Line Result +- RubyMotion (RM): A compiler toolchain that allows you to build native, cross-platform mobile + apps. [Home Page]() [FAQ Page]() +** Processing line: ~ environment that works on Windows, Mac, and Linux. [Home Page]() [FAQ Page]()~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +- Commandline Toolkit (CTK): A zero dependency, zero installation Ruby + environment that works on Windows, Mac, and Linux. [Home Page]() [FAQ Page]() +** Processing line: ~All of the products above leverage a shared core called DragonRuby.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +All of the products above leverage a shared core called DragonRuby. +** Processing line: ~NOTE: From an official branding standpoint each one of the products is~ +** Processing line: ~suffixed with "A DragonRuby LLP Product" tagline. Also, DragonRuby is~ +** Processing line: ~_one word, title cased_.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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_. +** Processing line: ~NOTE: We leave the "A DragonRuby LLP Product" off of this one because~ +** Processing line: ~that just sounds really weird.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +NOTE: We leave the "A DragonRuby LLP Product" off of this one because that just sounds really weird. +** Processing line: ~NOTE: Devs who use DragonRuby are "Dragon Riders/Riders of Dragons". That's a bad ass~ +** Processing line: ~identifier huh?~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +NOTE: Devs who use DragonRuby are "Dragon Riders/Riders of Dragons". That's a bad ass identifier huh? +** Processing line: ~*** What is DragonRuby?~ +- Header detected. +*** True Line Result + +*** True Line Result +*** What is DragonRuby? +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~The response to this question requires a few subparts. First we need~ +** Processing line: ~to clarify some terms. Specifically _language specification_ vs _runtime_.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +The response to this question requires a few subparts. First we need to clarify some terms. Specifically _language specification_ vs _runtime_. +** Processing line: ~*** Okay... so what is the difference between a language specification and a runtime?~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Okay... so what is the difference between a language specification and a runtime? +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~A runtime is an _implementation_ of a langauge specification. When~ +** Processing line: ~people say "Ruby," they are usually referring to "the Ruby 3.0+ language~ +** Processing line: ~specification implemented via the CRuby/MRI Runtime."~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +A runtime is an _implementation_ of a langauge specification. When people say "Ruby," they are usually referring to "the Ruby 3.0+ language specification implemented via the CRuby/MRI Runtime." +** Processing line: ~But, there are many Ruby Runtimes: CRuby/MRI, JRuby, Truffle, Rubinius, Artichoke,~ +** Processing line: ~and (last but certainly not least) DragonRuby.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +But, there are many Ruby Runtimes: CRuby/MRI, JRuby, Truffle, Rubinius, Artichoke, and (last but certainly not least) DragonRuby. +** Processing line: ~*** Okay... what language specification does DragonRuby use then?~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Okay... what language specification does DragonRuby use then? +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~DragonRuby's goal is to be compliant with the ISO/IEC 30170:2012 standard. It's~ +** Processing line: ~syntax is Ruby 2.x compatible, but also contains semantic changes that help~ +** Processing line: ~it natively interface with platform specific libraries.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~*** So... why another runtime?~ +- Header detected. +*** True Line Result + +*** True Line Result +*** So... why another runtime? +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~The elevator pitch is:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +The elevator pitch is: +** Processing line: ~DragonRuby is a Multilevel Cross-platform Runtime. The "multiple levels"~ +** Processing line: ~within the runtime allows us to target platforms no other Ruby can~ +** Processing line: ~target: PC, Mac, Linux, Raspberry Pi, WASM, iOS, Android, Nintendo~ +** Processing line: ~Switch, PS4, Xbox, and Scadia.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +DragonRuby is a Multilevel Cross-platform Runtime. The "multiple levels" within the runtime allows us to target platforms no other Ruby can target: PC, Mac, Linux, Raspberry Pi, WASM, iOS, Android, Nintendo Switch, PS4, Xbox, and Scadia. +** Processing line: ~*** What does Multilevel Cross-platform mean?~ +- Header detected. +*** True Line Result + +*** True Line Result +*** What does Multilevel Cross-platform mean? +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~There are complexities associated with targeting all the platforms we~ +** Processing line: ~support. Because of this, the runtime had to be architected in such a~ +** Processing line: ~way that new platforms could be easily added (which lead to us partitioning the~ +** Processing line: ~runtime internally):~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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): +** Processing line: ~- Level 1 we leverage a good portion of mRuby.~ +- Line was identified as a list. +*** True Line Result + +** Processing line: ~- Level 2 consists of optimizations to mRuby we've made given that our~ +- Line was identified as a list. +*** True Line Result +- Level 1 we leverage a good portion of mRuby. +** Processing line: ~ target platforms are well known.~ +** Processing line: ~- Level 3 consists of portable C libraries and their Ruby~ +- Line was identified as a list. +*** True Line Result +- Level 2 consists of optimizations to mRuby we've made given that our + target platforms are well known. +** Processing line: ~ C-Extensions.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +- Level 3 consists of portable C libraries and their Ruby + C-Extensions. +** Processing line: ~Levels 1 through 3 are fairly commonplace in many runtime~ +** Processing line: ~implemenations (with level 1 being the most portable, and level 3~ +** Processing line: ~being the fastest). But the DragonRuby Runtime has taken things a~ +** Processing line: ~bit further:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Levels 1 through 3 are fairly commonplace in many runtime implemenations (with level 1 being the most portable, and level 3 being the fastest). But the DragonRuby Runtime has taken things a bit further: +** Processing line: ~- Level 4 consists of shared abstractions around hardware I/O and operating~ +- Line was identified as a list. +*** True Line Result + +** Processing line: ~ system resources. This level leverages open source and proprietary~ +** Processing line: ~ components within Simple DirectMedia Layer (a lowlevel multimedia~ +** Processing line: ~ component library that has been in active development for 22 years~ +** Processing line: ~ and counting).~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +- 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 lowlevel multimedia component library that has been in active development for 22 years and counting). +** Processing line: ~- Level 5 is a codegeneration layer which creates metadata that allows~ +- Line was identified as a list. +*** True Line Result + +** Processing line: ~ for native interopability with host runtime libraries. It also~ +** Processing line: ~ includes OS specific message pump orchestrations.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +- Level 5 is a codegeneration layer which creates metadata that allows + for native interopability with host runtime libraries. It also includes OS specific message pump orchestrations. +** Processing line: ~- Level 6 is a Ahead of Time/Just in Time Ruby compiler built with LLVM. This~ +- Line was identified as a list. +*** True Line Result + +** Processing line: ~ compiler outputs _very_ fast platform specific bitcode, but only~ +** Processing line: ~ supports a subset of the Ruby language specification.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +- 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. +** Processing line: ~These levels allow us to stay up to date with open source~ +** Processing line: ~implementations of Ruby; provide fast, native code execution~ +** Processing line: ~on proprietary platforms; ensure good seperation between these two~ +** Processing line: ~worlds; and provides a means to add new platforms without going insane.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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 seperation between these two worlds; and provides a means to add new platforms without going insane. +** Processing line: ~*** Cool cool. So given that I understand everything to this point, can we answer the original question? What is DragonRuby?~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Cool cool. So given that I understand everything to this point, can we answer the original question? What is DragonRuby? +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~DragonRuby is a Ruby runtime implentation that takes all the lessons~ +** Processing line: ~we've learned from MRI/CRuby, and merges it with the latest and greatest~ +** Processing line: ~compiler and OSS technologies.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +DragonRuby is a Ruby runtime implentation that takes all the lessons we've learned from MRI/CRuby, and merges it with the latest and greatest compiler and OSS technologies. +** Processing line: ~** Frequent Comments~ +- Header detected. +*** True Line Result + +*** True Line Result +** Frequent Comments +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** But Ruby is dead.~ +- Header detected. +*** True Line Result + +*** True Line Result +*** But Ruby is dead. +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Let's check the official source for the answer to this question:~ +** Processing line: ~isrubydead.com: [[https://isrubydead.com/]].~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Let's check the official source for the answer to this question: isrubydead.com: [[https://isrubydead.com/]]. +** Processing line: ~On a more serious note, Ruby's _quantity_ levels aren't what they used~ +** Processing line: ~to be. And that's totally fine. Every one chases the new and shiny.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +On a more serious note, Ruby's _quantity_ levels aren't what they used to be. And that's totally fine. Every one chases the new and shiny. +** Processing line: ~What really matters is _quality/maturity_. Here is the latest (StackOverflow~ +** Processing line: ~Survey sorted by highest paid developers)[https://insights.stackoverflow.com/survey/2019#top-paying-technologies].~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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]. +** Processing line: ~Let's stop making this comment shall we?~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Let's stop making this comment shall we? +** Processing line: ~*** But Ruby is slow.~ +- Header detected. +*** True Line Result + +*** True Line Result +*** But Ruby is slow. +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~That doesn't make any sense. A language specification can't be~ +** Processing line: ~slow... it's a language spec. Sure, an _implementation/runtime_ can be slow though, but then we'd~ +** Processing line: ~have to talk about which runtime.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~*** Dynamic langauges are slow.~ +- Header detected. +*** True Line Result + +*** True Line Result +*** Dynamic langauges are slow. +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~They are certainly slower than statically compiled languages. With the~ +** Processing line: ~processing power and compiler optimizations we have today,~ +** Processing line: ~dynamic languages like Ruby are _fast enough_.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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_. +** Processing line: ~Unless you are writing in some form of intermediate representation by hand,~ +** Processing line: ~your langauge of choice also suffers this same fallacy of slow. Like, nothing is~ +** Processing line: ~faster than a low level assembly-like language. So unless you're~ +** Processing line: ~writing in that, let's stop making this comment.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Unless you are writing in some form of intermediate representation by hand, your langauge 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. +** Processing line: ~NOTE: If you _are_ hand writing LLVM IR, we are always open to~ +** Processing line: ~bringing on new partners with such a skillset. Email us ^_^.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +NOTE: If you _are_ hand writing LLVM IR, we are always open to bringing on new partners with such a skillset. Email us ^_^. +** Processing line: ~** Frequent Concerns~ +- Header detected. +*** True Line Result + +*** True Line Result +** Frequent Concerns +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~*** DragonRuby is not open source. That's not right.~ +- Header detected. +*** True Line Result + +*** True Line Result +*** DragonRuby is not open source. That's not right. +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~The current state of open source is unsustainable. Contributors work~ +** Processing line: ~for free, most all open source repositories are serverly understaffed,~ +** Processing line: ~and burnout from core members is rampant.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +The current state of open source is unsustainable. Contributors work for free, most all open source repositories are serverly understaffed, and burnout from core members is rampant. +** Processing line: ~We believe in open source very strongly. Parts of DragonRuby are~ +** Processing line: ~infact, open source. Just not all of it (for legal reasons, and~ +** Processing line: ~because the IP we've created has value). And we promise that we are~ +** Processing line: ~looking for (or creating) ways to _sustainably_ open source everything we do.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +We believe in open source very strongly. Parts of DragonRuby are infact, 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. +** Processing line: ~If you have ideas on how we can do this, email us!~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +If you have ideas on how we can do this, email us! +** Processing line: ~If the reason above isn't sufficient, then definitely use something else.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +If the reason above isn't sufficient, then definitely use something else. +** Processing line: ~*** DragonRuby is for pay. You should offer a free version.~ +- Header detected. +*** True Line Result + +*** True Line Result +*** DragonRuby is for pay. You should offer a free version. +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~If you can afford to pay for DragonRuby, you should (and will). We don't go~ +** Processing line: ~around telling writers that they should give us their books for free,~ +** Processing line: ~and only require payment if we read the entire thing. It's time we stop asking that~ +** Processing line: ~of software products.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~That being said, we will _never_ put someone out financially. We have~ +** Processing line: ~income assistance for anyone that can't afford a license to any one of~ +** Processing line: ~our products.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~You qualify for a free, unrestricted license to DragonRuby products if~ +** Processing line: ~any of the following items pertain to you:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +You qualify for a free, unrestricted license to DragonRuby products if any of the following items pertain to you: +** Processing line: ~- Your income is below $2,000.00 (USD) per month.~ +- Line was identified as a list. +*** True Line Result + +** Processing line: ~- You are under 18 years of age.~ +- Line was identified as a list. +*** True Line Result +- Your income is below $2,000.00 (USD) per month. +** Processing line: ~- You are a student of any type: traditional public school, home~ +- Line was identified as a list. +*** True Line Result +- You are under 18 years of age. +** Processing line: ~ schooling, college, bootcamp, or online.~ +** Processing line: ~- You are a teacher, mentor, or parent who wants to teach a kid how to code.~ +- Line was identified as a list. +*** True Line Result +- You are a student of any type: traditional public school, home + schooling, college, bootcamp, or online. +** Processing line: ~- You work/worked in public service or at a charitable organization:~ +- Line was identified as a list. +*** True Line Result +- You are a teacher, mentor, or parent who wants to teach a kid how to code. +** Processing line: ~ for example public office, army, or any 501(c)(3) organization.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +- You work/worked in public service or at a charitable organization: + for example public office, army, or any 501(c)(3) organization. +** Processing line: ~Just contact Amir at [email protected] with a short~ +** Processing line: ~explanation of your current situation and he'll set you up. No~ +** Processing line: ~questions asked.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Just contact Amir at [email protected] with a short explanation of your current situation and he'll set you up. No questions asked. +** Processing line: ~*** But still, you should offer a free version. So I can try it out and see if I like it.~ +- Header detected. +*** True Line Result + +*** True Line Result +*** But still, you should offer a free version. So I can try it out and see if I like it. +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~You can try our [web-based sandbox environment](). But it won't do the~ +** Processing line: ~runtime justice. Or just come to our [Slack]() or [Discord]() channel~ +** Processing line: ~and ask questions. We'd be happy to have a one on one video chat with~ +** Processing line: ~you and show off all the cool stuff we're doing.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +You can try our [web-based sandbox environment](). But it won't do the runtime justice. Or just come to our [Slack]() or [Discord]() channel and ask questions. We'd be happy to have a one on one video chat with you and show off all the cool stuff we're doing. +** Processing line: ~Seriously just buy it. Get a refund if you don't like it. We make it~ +** Processing line: ~stupid easy to do so.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Seriously just buy it. Get a refund if you don't like it. We make it stupid easy to do so. +** Processing line: ~*** I still think you should do a free version. Think of all people who would give it a shot.~ +- Header detected. +*** True Line Result + +*** True Line Result +*** I still think you should do a free version. Think of all people who would give it a shot. +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Free isn't a sustainable financial model. We don't want to spam your~ +** Processing line: ~email. We don't want to collect usage data off of you either. We just~ +** Processing line: ~want to provide quality toolchains to quality developers (as opposed~ +** Processing line: ~to a large quantity of developers).~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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). +** Processing line: ~The peiple that pay for DragonRuby and make an effort to understand it are the~ +** Processing line: ~ones we want to build a community around, partner with, and collaborate~ +** Processing line: ~with. So having that small monetary wall deters entitled individuals~ +** Processing line: ~that don't value the same things we do.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +The peiple 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. +** Processing line: ~*** What if I build something with DragonRuby, but DragonRuby LLP becomes insolvent.~ +- Header detected. +*** True Line Result + +*** True Line Result +*** What if I build something with DragonRuby, but DragonRuby LLP becomes insolvent. +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~That won't happen if the development world stop asking for free stuff~ +** Processing line: ~and non-trivially compensate open source developers. Look, we want to be~ +** Processing line: ~able to work on the stuff we love, every day of our lives. And we'll go~ +** Processing line: ~to great lengths to make that happen.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~But, in the event that sad day comes, our partnershiop bylaws state that~ +** Processing line: ~_all_ DragonRuby IP that can be legally open sourced, will be released~ +** Processing line: ~under a permissive license.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +But, in the event that sad day comes, our partnershiop bylaws state that _all_ DragonRuby IP that can be legally open sourced, will be released under a permissive license. +** Processing line: ~* DOCS: ~GTK::Runtime~~ +- Header detected. +*** True Line Result + +*** True Line Result +* DOCS: ~GTK::Runtime~ +** Processing line: ~The GTK::Runtime class is the core of DragonRuby. It is globally accessible via ~$gtk~.~ +** Processing line: ~~ +- 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#calcstringbox~~ +- Header detected. +*** True Line Result + +*** True Line Result +* DOCS: ~GTK::Runtime#calcstringbox~ +** Processing line: ~This function returns the width and height of a string.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +This function returns the width and height of a string. +** Processing line: ~#+begin_src ruby~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src ruby +** Processing line: ~ def tick args~ +- Inside source: true +*** True Line Result + def tick args +** Processing line: ~ args.state.string_size ||= args.gtk.calcstringbox "Hello World"~ +- Inside source: true +*** True Line Result + args.state.string_size ||= args.gtk.calcstringbox "Hello World" +** Processing line: ~ args.state.string_size_font_size ||= args.gtk.calcstringbox "Hello World"~ +- Inside source: true +*** True Line Result + args.state.string_size_font_size ||= args.gtk.calcstringbox "Hello World" +** 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: ~GTK::Runtime#reset~~ +- Header detected. +*** True Line Result + +*** True Line Result +* DOCS: ~GTK::Runtime#reset~ +** Processing line: ~This function will reset Kernel.tick_count to 0 and will remove all data from args.state.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +This function will reset Kernel.tick_count to 0 and will remove all data from args.state. +** Processing line: ~* DOCS: ~Array~~ +- Header detected. +*** True Line Result + +*** True Line Result +* DOCS: ~Array~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~The Array class has been extend to provide methods that~ +** Processing line: ~will help in common game development tasks. Array is one of the most~ +** Processing line: ~powerful classes in Ruby and a very fundamental component of Game Toolkit.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~* DOCS: ~Array#map~~ +- Header detected. +*** True Line Result + +*** True Line Result +* DOCS: ~Array#map~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~The function given a block returns a new ~Enumerable~ of values.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +The function given a block returns a new ~Enumerable~ of values. +** Processing line: ~Example of using ~Array#map~ in conjunction with ~args.state~ and~ +** Processing line: ~~args.outputs.sprites~ to render sprites to the screen.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Example of using ~Array#map~ in conjunction with ~args.state~ and ~args.outputs.sprites~ to render sprites to the screen. +** 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: ~ # define the colors of the rainbow in ~args.state~~ +- Inside source: true +*** True Line Result + # define the colors of the rainbow in ~args.state~ +** Processing line: ~ # as an ~Array~ of ~Hash~es with :order and :name.~ +- Inside source: true +*** True Line Result + # as an ~Array~ of ~Hash~es with :order and :name. +** Processing line: ~ # :order will be used to determine render location~ +- Inside source: true +*** True Line Result + # :order will be used to determine render location +** Processing line: ~ # and :name will be used to determine sprite path.~ +- Inside source: true +*** True Line Result + # and :name will be used to determine sprite path. +** Processing line: ~ args.state.rainbow_colors ||= [~ +- Inside source: true +*** True Line Result + args.state.rainbow_colors ||= [ +** Processing line: ~ { order: 0, name: :red },~ +- Inside source: true +*** True Line Result + { order: 0, name: :red }, +** Processing line: ~ { order: 1, name: :orange },~ +- Inside source: true +*** True Line Result + { order: 1, name: :orange }, +** Processing line: ~ { order: 2, name: :yellow },~ +- Inside source: true +*** True Line Result + { order: 2, name: :yellow }, +** Processing line: ~ { order: 3, name: :green },~ +- Inside source: true +*** True Line Result + { order: 3, name: :green }, +** Processing line: ~ { order: 4, name: :blue },~ +- Inside source: true +*** True Line Result + { order: 4, name: :blue }, +** Processing line: ~ { order: 5, name: :indigo },~ +- Inside source: true +*** True Line Result + { order: 5, name: :indigo }, +** Processing line: ~ { order: 6, name: :violet },~ +- Inside source: true +*** True Line Result + { order: 6, name: :violet }, +** Processing line: ~ ]~ +- Inside source: true +*** True Line Result + ] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # render sprites diagonally to the screen~ +- Inside source: true +*** True Line Result + # render sprites diagonally to the screen +** Processing line: ~ # with a width and height of 50.~ +- Inside source: true +*** True Line Result + # with a width and height of 50. +** Processing line: ~ args.outputs~ +- Inside source: true +*** True Line Result + args.outputs +** Processing line: ~ .sprites << args.state~ +- Inside source: true +*** True Line Result + .sprites << args.state +** Processing line: ~ .rainbow_colors~ +- Inside source: true +*** True Line Result + .rainbow_colors +** Processing line: ~ .map do |color| # <-- ~Array#map~ usage~ +- Inside source: true +*** True Line Result + .map do |color| # <-- ~Array#map~ usage +** Processing line: ~ [~ +- Inside source: true +*** True Line Result + [ +** Processing line: ~ color[:order] * 50,~ +- Inside source: true +*** True Line Result + color[:order] * 50, +** Processing line: ~ color[:order] * 50,~ +- Inside source: true +*** True Line Result + color[:order] * 50, +** Processing line: ~ 50,~ +- Inside source: true +*** True Line Result + 50, +** Processing line: ~ 50,~ +- Inside source: true +*** True Line Result + 50, +** Processing line: ~ "sprites/square-#{color[:name]}.png"~ +- Inside source: true +*** True Line Result + "sprites/square-#{color[:name]}.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: ~#+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: ~Array#each~~ +- Header detected. +*** True Line Result + +*** True Line Result +* DOCS: ~Array#each~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~The function, given a block, invokes the block for each item in the~ +** Processing line: ~~Array~. ~Array#each~ is synonymous to foreach constructs in other languages.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +The function, given a block, invokes the block for each item in the ~Array~. ~Array#each~ is synonymous to foreach constructs in other languages. +** Processing line: ~Example of using ~Array#each~ in conjunction with ~args.state~ and~ +** Processing line: ~~args.outputs.sprites~ to render sprites to the screen:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Example of using ~Array#each~ in conjunction with ~args.state~ and ~args.outputs.sprites~ to render sprites to the screen: +** 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: ~ # define the colors of the rainbow in ~args.state~~ +- Inside source: true +*** True Line Result + # define the colors of the rainbow in ~args.state~ +** Processing line: ~ # as an ~Array~ of ~Hash~es with :order and :name.~ +- Inside source: true +*** True Line Result + # as an ~Array~ of ~Hash~es with :order and :name. +** Processing line: ~ # :order will be used to determine render location~ +- Inside source: true +*** True Line Result + # :order will be used to determine render location +** Processing line: ~ # and :name will be used to determine sprite path.~ +- Inside source: true +*** True Line Result + # and :name will be used to determine sprite path. +** Processing line: ~ args.state.rainbow_colors ||= [~ +- Inside source: true +*** True Line Result + args.state.rainbow_colors ||= [ +** Processing line: ~ { order: 0, name: :red },~ +- Inside source: true +*** True Line Result + { order: 0, name: :red }, +** Processing line: ~ { order: 1, name: :orange },~ +- Inside source: true +*** True Line Result + { order: 1, name: :orange }, +** Processing line: ~ { order: 2, name: :yellow },~ +- Inside source: true +*** True Line Result + { order: 2, name: :yellow }, +** Processing line: ~ { order: 3, name: :green },~ +- Inside source: true +*** True Line Result + { order: 3, name: :green }, +** Processing line: ~ { order: 4, name: :blue },~ +- Inside source: true +*** True Line Result + { order: 4, name: :blue }, +** Processing line: ~ { order: 5, name: :indigo },~ +- Inside source: true +*** True Line Result + { order: 5, name: :indigo }, +** Processing line: ~ { order: 6, name: :violet },~ +- Inside source: true +*** True Line Result + { order: 6, name: :violet }, +** Processing line: ~ ]~ +- Inside source: true +*** True Line Result + ] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # render sprites diagonally to the screen~ +- Inside source: true +*** True Line Result + # render sprites diagonally to the screen +** Processing line: ~ # with a width and height of 50.~ +- Inside source: true +*** True Line Result + # with a width and height of 50. +** Processing line: ~ args.state~ +- Inside source: true +*** True Line Result + args.state +** Processing line: ~ .rainbow_colors~ +- Inside source: true +*** True Line Result + .rainbow_colors +** Processing line: ~ .map do |color| # <-- ~Array#each~ usage~ +- Inside source: true +*** True Line Result + .map do |color| # <-- ~Array#each~ usage +** Processing line: ~ args.outputs.sprites << [~ +- Inside source: true +*** True Line Result + args.outputs.sprites << [ +** Processing line: ~ color[:order] * 50,~ +- Inside source: true +*** True Line Result + color[:order] * 50, +** Processing line: ~ color[:order] * 50,~ +- Inside source: true +*** True Line Result + color[:order] * 50, +** Processing line: ~ 50,~ +- Inside source: true +*** True Line Result + 50, +** Processing line: ~ 50,~ +- Inside source: true +*** True Line Result + 50, +** Processing line: ~ "sprites/square-#{color[:name]}.png"~ +- Inside source: true +*** True Line Result + "sprites/square-#{color[:name]}.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: ~#+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: ~Array#reject_nil~~ +- Header detected. +*** True Line Result + +*** True Line Result +* DOCS: ~Array#reject_nil~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Returns an ~Enumerable~ rejecting items that are ~nil~, this is an alias~ +** Processing line: ~for ~Array#compact~:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Returns an ~Enumerable~ rejecting items that are ~nil~, this is an alias for ~Array#compact~: +** Processing line: ~#+begin_src~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src +** Processing line: ~ repl do~ +- Inside source: true +*** True Line Result + repl do +** Processing line: ~ a = [1, nil, 4, false, :a]~ +- Inside source: true +*** True Line Result + a = [1, nil, 4, false, :a] +** Processing line: ~ puts a.reject_nil~ +- Inside source: true +*** True Line Result + puts a.reject_nil +** Processing line: ~ # => [1, 4, false, :a]~ +- Inside source: true +*** True Line Result + # => [1, 4, false, :a] +** Processing line: ~ puts a.compact~ +- Inside source: true +*** True Line Result + puts a.compact +** Processing line: ~ # => [1, 4, false, :a]~ +- Inside source: true +*** True Line Result + # => [1, 4, false, :a] +** 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: ~Array#reject_false~~ +- Header detected. +*** True Line Result + +*** True Line Result +* DOCS: ~Array#reject_false~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Returns an `Enumerable` rejecting items that are `nil` or `false`.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Returns an `Enumerable` rejecting items that are `nil` or `false`. +** Processing line: ~#+begin_src~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src +** Processing line: ~ repl do~ +- Inside source: true +*** True Line Result + repl do +** Processing line: ~ a = [1, nil, 4, false, :a]~ +- Inside source: true +*** True Line Result + a = [1, nil, 4, false, :a] +** Processing line: ~ puts a.reject_false~ +- Inside source: true +*** True Line Result + puts a.reject_false +** Processing line: ~ # => [1, 4, :a]~ +- Inside source: true +*** True Line Result + # => [1, 4, :a] +** 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: ~Array#product~~ +- Header detected. +*** True Line Result + +*** True Line Result +* DOCS: ~Array#product~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Returns all combinations of values between two arrays.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Returns all combinations of values between two arrays. +** Processing line: ~Here are some examples of using ~product~. Paste the~ +** Processing line: ~following code at the bottom of main.rb and save~ +** Processing line: ~the file to see the results:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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: +** Processing line: ~#+begin_src~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src +** Processing line: ~ repl do~ +- Inside source: true +*** True Line Result + repl do +** Processing line: ~ a = [0, 1]~ +- Inside source: true +*** True Line Result + a = [0, 1] +** Processing line: ~ puts a.product~ +- Inside source: true +*** True Line Result + puts a.product +** Processing line: ~ # => [[0, 0], [0, 1], [1, 0], [1, 1]]~ +- Inside source: true +*** True Line Result + # => [[0, 0], [0, 1], [1, 0], [1, 1]] +** 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: ~#+begin_src~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src +** Processing line: ~ repl do~ +- Inside source: true +*** True Line Result + repl do +** Processing line: ~ a = [ 0, 1]~ +- Inside source: true +*** True Line Result + a = [ 0, 1] +** Processing line: ~ b = [:a, :b]~ +- Inside source: true +*** True Line Result + b = [:a, :b] +** Processing line: ~ puts a.product b~ +- Inside source: true +*** True Line Result + puts a.product b +** Processing line: ~ # => [[0, :a], [0, :b], [1, :a], [1, :b]]~ +- Inside source: true +*** True Line Result + # => [[0, :a], [0, :b], [1, :a], [1, :b]] +** 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: ~Array#map_2d~~ +- Header detected. +*** True Line Result + +*** True Line Result +* DOCS: ~Array#map_2d~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Assuming the array is an array of arrays, Given a block, each 2D array index invoked against the block.~ +** Processing line: ~A 2D array is a common way to store data/layout for a stage.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~#+begin_src~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src +** Processing line: ~ repl do~ +- Inside source: true +*** True Line Result + repl do +** Processing line: ~ stage = [~ +- Inside source: true +*** True Line Result + stage = [ +** Processing line: ~ [:enemy, :empty, :player],~ +- Inside source: true +*** True Line Result + [:enemy, :empty, :player], +** Processing line: ~ [:empty, :empty, :empty],~ +- Inside source: true +*** True Line Result + [:empty, :empty, :empty], +** Processing line: ~ [:enemy, :empty, :enemy],~ +- Inside source: true +*** True Line Result + [:enemy, :empty, :enemy], +** Processing line: ~ ]~ +- Inside source: true +*** True Line Result + ] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ occupied_tiles = stage.map_2d do |row, col, tile|~ +- Inside source: true +*** True Line Result + occupied_tiles = stage.map_2d do |row, col, tile| +** Processing line: ~ if tile == :empty~ +- Inside source: true +*** True Line Result + if tile == :empty +** Processing line: ~ nil~ +- Inside source: true +*** True Line Result + nil +** Processing line: ~ else~ +- Inside source: true +*** True Line Result + else +** Processing line: ~ [row, col, tile]~ +- Inside source: true +*** True Line Result + [row, col, tile] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end.reject_nil~ +- Inside source: true +*** True Line Result + end.reject_nil +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ puts "Stage:"~ +- Inside source: true +*** True Line Result + puts "Stage:" +** Processing line: ~ puts stage~ +- Inside source: true +*** True Line Result + puts stage +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ puts "Occupied Tiles"~ +- Inside source: true +*** True Line Result + puts "Occupied Tiles" +** Processing line: ~ puts occupied_tiles~ +- Inside source: true +*** True Line Result + puts occupied_tiles +** 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: ~Array#include_any?~~ +- Header detected. +*** True Line Result + +*** True Line Result +* DOCS: ~Array#include_any?~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Given a collection of items, the function will return~ +** Processing line: ~~true~ if any of ~self~'s items exists in the collection of items passed in:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Given a collection of items, the function will return ~true~ if any of ~self~'s items exists in the collection of items passed in: +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~* DOCS: ~Array#any_intersect_rect?~~ +- Header detected. +*** True Line Result + +*** True Line Result +* DOCS: ~Array#any_intersect_rect?~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Assuming the array contains objects that respond to ~left~, ~right~, ~top~, ~bottom~,~ +** Processing line: ~this method returns ~true~ if any of the elements within~ +** Processing line: ~the array intersect the object being passed in. You are given an optional~ +** Processing line: ~parameter called ~tolerance~ which informs how close to the other rectangles~ +** Processing line: ~the elements need to be for it to be considered intersecting.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~The default tolerance is set to ~0.1~, which means that the primitives are not~ +** Processing line: ~considered intersecting unless they are overlapping by more than ~0.1~.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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~. +** Processing line: ~#+begin_src~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src +** Processing line: ~ repl do~ +- Inside source: true +*** True Line Result + repl do +** Processing line: ~ # Here is a player class that has position and implement~ +- Inside source: true +*** True Line Result + # Here is a player class that has position and implement +** Processing line: ~ # the ~attr_rect~ contract.~ +- Inside source: true +*** True Line Result + # the ~attr_rect~ contract. +** Processing line: ~ class Player~ +- Inside source: true +*** True Line Result + class Player +** Processing line: ~ attr_rect~ +- Inside source: true +*** True Line Result + attr_rect +** Processing line: ~ attr_accessor :x, :y, :w, :h~ +- Inside source: true +*** True Line Result + attr_accessor :x, :y, :w, :h +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def initialize x, y, w, h~ +- Inside source: true +*** True Line Result + def initialize x, y, w, h +** 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: ~ 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: ~ { 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: ~ def inspect~ +- Inside source: true +*** True Line Result + def inspect +** 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 to_s~ +- Inside source: true +*** True Line Result + def to_s +** Processing line: ~ "#{serialize}"~ +- Inside source: true +*** True Line Result + "#{serialize}" +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Here is a definition of two walls.~ +- Inside source: true +*** True Line Result + # Here is a definition of two walls. +** Processing line: ~ walls = [~ +- Inside source: true +*** True Line Result + walls = [ +** Processing line: ~ [10, 10, 10, 10],~ +- Inside source: true +*** True Line Result + [10, 10, 10, 10], +** Processing line: ~ { x: 20, y: 20, w: 10, h: 10 },~ +- Inside source: true +*** True Line Result + { x: 20, y: 20, w: 10, h: 10 }, +** Processing line: ~ ]~ +- Inside source: true +*** True Line Result + ] +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Display the walls.~ +- Inside source: true +*** True Line Result + # Display the walls. +** Processing line: ~ puts "Walls."~ +- Inside source: true +*** True Line Result + puts "Walls." +** Processing line: ~ puts walls~ +- Inside source: true +*** True Line Result + puts walls +** Processing line: ~ puts ""~ +- Inside source: true +*** True Line Result + puts "" +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ # Check any_intersect_rect? on player~ +- Inside source: true +*** True Line Result + # Check any_intersect_rect? on player +** Processing line: ~ player = Player.new 30, 20, 10, 10~ +- Inside source: true +*** True Line Result + player = Player.new 30, 20, 10, 10 +** Processing line: ~ puts "Is Player #{player} touching wall?"~ +- Inside source: true +*** True Line Result + puts "Is Player #{player} touching wall?" +** Processing line: ~ puts (walls.any_intersect_rect? player)~ +- Inside source: true +*** True Line Result + puts (walls.any_intersect_rect? player) +** Processing line: ~ # => false~ +- Inside source: true +*** True Line Result + # => false +** Processing line: ~ # The value is false because of the default tolerance is 0.1.~ +- Inside source: true +*** True Line Result + # 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~ +- Inside source: true +*** True Line Result + # The overlap of the player rect and any of the wall rects is +** Processing line: ~ # less than 0.1 (for those that intersect).~ +- Inside source: true +*** True Line Result + # less than 0.1 (for those that intersect). +** Processing line: ~ puts ""~ +- Inside source: true +*** True Line Result + puts "" +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ player = Player.new 9, 10, 10, 10~ +- Inside source: true +*** True Line Result + player = Player.new 9, 10, 10, 10 +** Processing line: ~ puts "Is Player #{player} touching wall?"~ +- Inside source: true +*** True Line Result + puts "Is Player #{player} touching wall?" +** Processing line: ~ puts (walls.any_intersect_rect? player)~ +- Inside source: true +*** True Line Result + puts (walls.any_intersect_rect? player) +** Processing line: ~ # => true~ +- Inside source: true +*** True Line Result + # => true +** Processing line: ~ puts ""~ +- Inside source: true +*** True Line Result + puts "" +** 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 + +*** True Line Result +* DOCS: ~GTK::Outputs~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Outputs is how you render primitives to the screen. The minimal setup for~ +** Processing line: ~rendering something to the screen is via a ~tick~ method defined in~ +** Processing line: ~mygame/app/main.rb~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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 +** 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: ~ # code goes here~ +- Inside source: true +*** True Line Result + # code goes here +** 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#borders~~ +- Header detected. +*** True Line Result + +*** True Line Result +* DOCS: ~GTK::Outputs#borders~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Add primitives to this collection to render an unfilled solid to the screen. Take a look at the~ +** Processing line: ~documentation for Outputs#solids.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Add primitives to this collection to render an unfilled solid to the screen. Take a look at the documentation for Outputs#solids. +** Processing line: ~The only difference between the two primitives is where they are added.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +The only difference between the two primitives is where they are added. +** Processing line: ~Instead of using ~args.outputs.solids~:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Instead of using ~args.outputs.solids~: +** Processing line: ~#+begin_src~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src +** Processing line: ~ def tick args~ +- Inside source: true +*** True Line Result + def tick args +** Processing line: ~ # X Y WIDTH HEIGHT~ +- Inside source: true +*** True Line Result + # X Y WIDTH HEIGHT +** Processing line: ~ args.outputs.solids << [100, 100, 160, 90]~ +- Inside source: true +*** True Line Result + args.outputs.solids << [100, 100, 160, 90] +** 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: ~You have to use ~args.outputs.borders~:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +You have to use ~args.outputs.borders~: +** Processing line: ~#+begin_src~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src +** Processing line: ~ def tick args~ +- Inside source: true +*** True Line Result + def tick args +** Processing line: ~ # X Y WIDTH HEIGHT~ +- Inside source: true +*** True Line Result + # X Y WIDTH HEIGHT +** Processing line: ~ args.outputs.borders << [100, 100, 160, 90]~ +- Inside source: true +*** True Line Result + args.outputs.borders << [100, 100, 160, 90] +** 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#solids~~ +- Header detected. +*** True Line Result + +*** True Line Result +* DOCS: ~GTK::Outputs#solids~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Add primitives to this collection to render a solid to the screen.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Add primitives to this collection to render a solid to the screen. +** Processing line: ~** Rendering a solid using an Array~ +- Header detected. +*** True Line Result + +*** True Line Result +** Rendering a solid using an Array +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Creates a solid black rectangle located at 100, 100. 160 pixels~ +** Processing line: ~wide and 90 pixels tall.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Creates a solid black rectangle located at 100, 100. 160 pixels wide and 90 pixels tall. +** Processing line: ~#+begin_src~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src +** Processing line: ~ def tick args~ +- Inside source: true +*** True Line Result + def tick args +** Processing line: ~ # X Y WIDTH HEIGHT~ +- Inside source: true +*** True Line Result + # X Y WIDTH HEIGHT +** Processing line: ~ args.outputs.solids << [100, 100, 160, 90]~ +- Inside source: true +*** True Line Result + args.outputs.solids << [100, 100, 160, 90] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~** Rendering a solid using an Array with colors and alpha~ +- Header detected. +*** True Line Result + +*** True Line Result +** Rendering a solid using an Array with colors and alpha +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~The value for the color and alpha is an number between ~0~ and ~255~. The~ +** Processing line: ~alpha property is optional and will be set to ~255~ if not specified.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +The value for the color and alpha is an number between ~0~ and ~255~. The alpha property is optional and will be set to ~255~ if not specified. +** Processing line: ~Creates a green solid rectangle with an opacity of 50%.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Creates a green solid rectangle with an opacity of 50%. +** Processing line: ~#+begin_src~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src +** Processing line: ~ def tick args~ +- Inside source: true +*** True Line Result + def tick args +** Processing line: ~ # X Y WIDTH HEIGHT RED GREEN BLUE ALPHA~ +- Inside source: true +*** True Line Result + # X Y WIDTH HEIGHT RED GREEN BLUE ALPHA +** Processing line: ~ args.outputs.solids << [100, 100, 160, 90, 0, 255, 0, 128]~ +- Inside source: true +*** True Line Result + args.outputs.solids << [100, 100, 160, 90, 0, 255, 0, 128] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~** Rendering a solid using a Hash~ +- Header detected. +*** True Line Result + +*** True Line Result +** Rendering a solid using a Hash +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~If you want a more readable invocation. You can use the following hash to create a solid.~ +** Processing line: ~Any parameters that are not specified will be given a default value. The keys of the hash can~ +** Processing line: ~be provided in any order.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +If you want a more readable invocation. You can use the following hash to create a solid. Any parameters that are not specified will be given a default value. The keys of the hash can be provided in any order. +** Processing line: ~#+begin_src~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src +** Processing line: ~ def tick args~ +- Inside source: true +*** True Line Result + def tick args +** Processing line: ~ args.outputs.solids << {~ +- Inside source: true +*** True Line Result + args.outputs.solids << { +** Processing line: ~ x: 0,~ +- Inside source: true +*** True Line Result + x: 0, +** Processing line: ~ y: 0,~ +- Inside source: true +*** True Line Result + y: 0, +** Processing line: ~ w: 100,~ +- Inside source: true +*** True Line Result + w: 100, +** Processing line: ~ h: 100,~ +- Inside source: true +*** True Line Result + h: 100, +** Processing line: ~ r: 0,~ +- Inside source: true +*** True Line Result + r: 0, +** Processing line: ~ g: 255,~ +- Inside source: true +*** True Line Result + g: 255, +** Processing line: ~ b: 0,~ +- Inside source: true +*** True Line Result + b: 0, +** Processing line: ~ a: 255~ +- Inside source: true +*** True Line Result + a: 255 +** Processing line: ~ }~ +- Inside source: true +*** True Line Result + } +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~** Rendering a solid using a Class~ +- Header detected. +*** True Line Result + +*** True Line Result +** Rendering a solid using a Class +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~You can also create a class with solid/border properties and render it as a primitive.~ +** Processing line: ~ALL properties must on the class. *Additionally*, a method called ~primitive_marker~~ +** Processing line: ~must be defined on the class.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +You can also create a class with solid/border properties and render it as a primitive. ALL properties must on the class. *Additionally*, a method called ~primitive_marker~ must be defined on the class. +** Processing line: ~Here is an example:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Here is an example: +** Processing line: ~#+begin_src~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src +** Processing line: ~ # Create type with ALL solid properties AND primitive_marker~ +- Inside source: true +*** True Line Result + # Create type with ALL solid properties AND primitive_marker +** Processing line: ~ class Solid~ +- Inside source: true +*** True Line Result + class Solid +** Processing line: ~ attr_accessor :x, :y, :w, :h, :r, :g, :b, :a~ +- Inside source: true +*** True Line Result + attr_accessor :x, :y, :w, :h, :r, :g, :b, :a +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ def primitive_marker~ +- Inside source: true +*** True Line Result + def primitive_marker +** Processing line: ~ :solid~ +- Inside source: true +*** True Line Result + :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: ~ # Inherit from type~ +- Inside source: true +*** True Line Result + # Inherit from type +** Processing line: ~ class Square < Solid~ +- Inside source: true +*** True Line Result + class Square < Solid +** Processing line: ~ # constructor~ +- Inside source: true +*** True Line Result + # constructor +** Processing line: ~ def initialize x, y, size~ +- Inside source: true +*** True Line Result + def initialize x, y, size +** Processing line: ~ self.x = x~ +- Inside source: true +*** True Line Result + self.x = x +** Processing line: ~ self.y = y~ +- Inside source: true +*** True Line Result + self.y = y +** Processing line: ~ self.w = size~ +- Inside source: true +*** True Line Result + self.w = size +** Processing line: ~ self.h = size~ +- Inside source: true +*** True Line Result + self.h = size +** Processing line: ~ end~ +- Inside source: true +*** 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: ~ # render solid/border~ +- Inside source: true +*** True Line Result + # render solid/border +** Processing line: ~ args.outputs.solids << Square.new(10, 10, 32)~ +- Inside source: true +*** True Line Result + args.outputs.solids << Square.new(10, 10, 32) +** 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::Mouse~~ +- Header detected. +*** True Line Result + +*** True Line Result +* DOCS: ~GTK::Mouse~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~The mouse is accessible via ~args.inputs.mouse~:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +The mouse is accessible via ~args.inputs.mouse~: +** 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: ~ # Rendering a label that shows the mouse's x and y position (via args.inputs.mouse).~ +- Inside source: true +*** True Line Result + # Rendering a label that shows the mouse's x and y position (via args.inputs.mouse). +** Processing line: ~ args.outputs.labels << [~ +- Inside source: true +*** True Line Result + args.outputs.labels << [ +** Processing line: ~ 10,~ +- Inside source: true +*** True Line Result + 10, +** Processing line: ~ 710,~ +- Inside source: true +*** True Line Result + 710, +** Processing line: ~ "The mouse's position is: #{args.inputs.mouse.x} #{args.inputs.mouse.y}."~ +- Inside source: true +*** True Line Result + "The mouse's position is: #{args.inputs.mouse.x} #{args.inputs.mouse.y}." +** 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: ~The mouse has the following properties.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +The mouse has the following properties. +** Processing line: ~- ~args.inputs.mouse.x~: Returns the x position of the mouse.~ +- Line was identified as a list. +*** True Line Result + +** Processing line: ~- ~args.inputs.mouse.y~: Returns the y position of the mouse.~ +- Line was identified as a list. +*** True Line Result +- ~args.inputs.mouse.x~: Returns the x position of the mouse. +** Processing line: ~- ~args.inputs.mouse.moved~: Returns true if the mouse moved during the tick.~ +- Line was identified as a list. +*** True Line Result +- ~args.inputs.mouse.y~: Returns the y position of the mouse. +** 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.~ +- Line was identified as a list. +*** True Line Result +- ~args.inputs.mouse.moved~: Returns true if the mouse moved during the tick. +** 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.~ +- Line was identified as a list. +*** True Line Result +- ~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. +** Processing line: ~- ~args.inputs.mouse.click~: Returns a ~GTK::MousePoint~ for that specific frame (~args.state.tick_count~) if the mouse button was pressed.~ +- Line was identified as a list. +*** True Line Result +- ~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. +** 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.~ +- Line was identified as a list. +*** True Line Result +- ~args.inputs.mouse.click~: Returns a ~GTK::MousePoint~ for that specific frame (~args.state.tick_count~) if the mouse button was pressed. +** Processing line: ~- ~args.inputs.mouse.up~: Returns true if for that specific frame (~args.state.tick_count~) if the mouse button was released.~ +- Line was identified as a list. +*** True Line Result +- ~args.inputs.mouse.previous_click~: Returns a ~GTK::MousePoint~ for the previous frame (~args.state.tick_count - 1~) if the mouse button was pressed. +** Processing line: ~- ~args.inputs.mouse.point~ | ~args.inputs.mouse.position~: Returns an ~Array~ which contains the ~x~ and ~y~ position of the mouse.~ +- Line was identified as a list. +*** True Line Result +- ~args.inputs.mouse.up~: Returns true if for that specific frame (~args.state.tick_count~) if the mouse button was released. +** Processing line: ~- ~args.inputs.mouse.has_focus~: Returns true if the game window has the mouse's focus.~ +- Line was identified as a list. +*** True Line Result +- ~args.inputs.mouse.point~ | ~args.inputs.mouse.position~: Returns an ~Array~ which contains the ~x~ and ~y~ position of the mouse. +** 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~.~ +- Line was identified as a list. +*** True Line Result +- ~args.inputs.mouse.has_focus~: Returns true if the game window has the mouse's focus. +** Processing line: ~- ~args.inputs.mouse.button_left~: Returns true if the left mouse button is down.~ +- Line was identified as a list. +*** True Line Result +- ~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~. +** Processing line: ~- ~args.inputs.mouse.button_right~: Returns true if the right mouse button is down.~ +- Line was identified as a list. +*** True Line Result +- ~args.inputs.mouse.button_left~: Returns true if the left mouse button is down. +** Processing line: ~- ~args.inputs.mouse.button_middle~: Returns true if the middle mouse button is down.~ +- Line was identified as a list. +*** True Line Result +- ~args.inputs.mouse.button_right~: Returns true if the right mouse button is down. +** Processing line: ~- ~args.inputs.mouse.button_bits~: Gives the bits for each mouse button and its current state.~ +- Line was identified as a list. +*** True Line Result +- ~args.inputs.mouse.button_middle~: Returns true if the middle mouse button is down. +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +- ~args.inputs.mouse.button_bits~: Gives the bits for each mouse button and its current state. +** Processing line: ~* DOCS: ~GTK::MousePoint~~ +- Header detected. +*** True Line Result + +*** True Line Result +* DOCS: ~GTK::MousePoint~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~The ~GTK::MousePoint~ has the following properties.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +The ~GTK::MousePoint~ has the following properties. +** Processing line: ~- ~x~: Integer representing the mouse's x.~ +- Line was identified as a list. +*** True Line Result + +** Processing line: ~- ~y~: Integer representing the mouse's y.~ +- Line was identified as a list. +*** True Line Result +- ~x~: Integer representing the mouse's x. +** Processing line: ~- ~point~: Array with the ~x~ and ~y~ values.~ +- Line was identified as a list. +*** True Line Result +- ~y~: Integer representing the mouse's y. +** Processing line: ~- ~w~: Width of the point that always returns ~0~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).~ +- Line was identified as a list. +*** True Line Result +- ~point~: Array with the ~x~ and ~y~ values. +** Processing line: ~- ~h~: Height of the point that always returns ~0~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).~ +- Line was identified as a list. +*** True Line Result +- ~w~: Width of the point that always returns ~0~ (included so that it can seemlessly work with ~GTK::Geometry~ functions). +** Processing line: ~- ~left~: This value is the same as ~x~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).~ +- Line was identified as a list. +*** True Line Result +- ~h~: Height of the point that always returns ~0~ (included so that it can seemlessly work with ~GTK::Geometry~ functions). +** Processing line: ~- ~right~: This value is the same as ~x~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).~ +- Line was identified as a list. +*** True Line Result +- ~left~: This value is the same as ~x~ (included so that it can seemlessly work with ~GTK::Geometry~ functions). +** Processing line: ~- ~top~: This value is the same as ~y~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).~ +- Line was identified as a list. +*** True Line Result +- ~right~: This value is the same as ~x~ (included so that it can seemlessly work with ~GTK::Geometry~ functions). +** Processing line: ~- ~bottom~: This value is the same as ~y~ (included so that it can seemlessly work with ~GTK::Geometry~ functions).~ +- Line was identified as a list. +*** True Line Result +- ~top~: This value is the same as ~y~ (included so that it can seemlessly work with ~GTK::Geometry~ functions). +** Processing line: ~- ~created_at~: The tick (~args.state.tick_count~) that this structure was created.~ +- Line was identified as a list. +*** True Line Result +- ~bottom~: This value is the same as ~y~ (included so that it can seemlessly work with ~GTK::Geometry~ functions). +** Processing line: ~- ~global_created_at~: The global tick (~Kernel.global_tick_count~) that this structure was created.~ +- Line was identified as a list. +*** True Line Result +- ~created_at~: The tick (~args.state.tick_count~) that this structure was created. +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +- ~global_created_at~: The global tick (~Kernel.global_tick_count~) that this structure was created. +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~* DOCS: ~GTK::OpenEntity~~ +- Header detected. +*** True Line Result + +*** True Line Result +* DOCS: ~GTK::OpenEntity~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~~GTK::OpenEntity~ is accessible within the DragonRuby's top level~ +** Processing line: ~~tick~ function via the ~args.state~ property.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +~GTK::OpenEntity~ is accessible within the DragonRuby's top level ~tick~ function via the ~args.state~ property. +** Processing line: ~#+begin_src~ +- Line was identified as the beginning of a code block. +*** True Line Result + +*** True Line Result +#+begin_src +** Processing line: ~ def tick args~ +- Inside source: true +*** True Line Result + def tick args +** Processing line: ~ args.state.x ||= 100~ +- Inside source: true +*** True Line Result + args.state.x ||= 100 +** Processing line: ~ args.outputs.labels << [10, 710, "value of x is: #{args.state.x}."]~ +- Inside source: true +*** True Line Result + args.outputs.labels << [10, 710, "value of x is: #{args.state.x}."] +** 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: ~The primary benefit of using ~args.state~ as opposed to instance~ +** Processing line: ~variables is that ~GTK::OpenEntity~ allows for arbitrary nesting~ +** Processing line: ~of properties without the need to create intermediate objects.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~For example:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +For 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: ~ # intermediate player object does not need to be created~ +- Inside source: true +*** True Line Result + # intermediate player object does not need to be created +** Processing line: ~ args.state.player.x ||= 100~ +- Inside source: true +*** True Line Result + args.state.player.x ||= 100 +** Processing line: ~ args.state.player.y ||= 100~ +- Inside source: true +*** True Line Result + args.state.player.y ||= 100 +** Processing line: ~ args.outputs.labels << [~ +- Inside source: true +*** True Line Result + args.outputs.labels << [ +** Processing line: ~ 10,~ +- Inside source: true +*** True Line Result + 10, +** Processing line: ~ 710,~ +- Inside source: true +*** True Line Result + 710, +** Processing line: ~ "player x, y is:#{args.state.player.x}, #{args.state.player.y}."~ +- Inside source: true +*** True Line Result + "player x, y is:#{args.state.player.x}, #{args.state.player.y}." +** 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::OpenEntity#as_hash~~ +- Header detected. +*** True Line Result + +*** True Line Result +* DOCS: ~GTK::OpenEntity#as_hash~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Returns a reference to the ~GTK::OpenEntity~ as a ~Hash~. This~ +** Processing line: ~property is useful when you want to treat ~args.state~ as a ~Hash~ and~ +** Processing line: ~invoke methods such as ~Hash#each~.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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~. +** Processing line: ~Example:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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: ~ args.state.x ||= 100~ +- Inside source: true +*** True Line Result + args.state.x ||= 100 +** Processing line: ~ args.state.y ||= 100~ +- Inside source: true +*** True Line Result + args.state.y ||= 100 +** Processing line: ~ values = args.state~ +- Inside source: true +*** True Line Result + values = args.state +** Processing line: ~ .as_hash~ +- Inside source: true +*** True Line Result + .as_hash +** Processing line: ~ .map { |k, v| "#{k} #{v}" }~ +- Inside source: true +*** True Line Result + .map { |k, v| "#{k} #{v}" } +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ args.outputs.labels << values.map.with_index do |v, i|~ +- Inside source: true +*** True Line Result + args.outputs.labels << values.map.with_index do |v, i| +** Processing line: ~ [~ +- Inside source: true +*** True Line Result + [ +** Processing line: ~ 10,~ +- Inside source: true +*** True Line Result + 10, +** Processing line: ~ 710 - (30 * i),~ +- Inside source: true +*** True Line Result + 710 - (30 * i), +** Processing line: ~ v~ +- Inside source: true +*** True Line Result + v +** Processing line: ~ ]~ +- Inside source: true +*** True Line Result + ] +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~ end~ +- Inside source: true +*** True Line Result + end +** Processing line: ~#+end_src~ +- Line was identified as the end of a code block. +*** True Line Result +#+end_src +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~* DOCS: ~Numeric#frame_index~~ +- Header detected. +*** True Line Result + +*** True Line Result +* DOCS: ~Numeric#frame_index~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~This function is helpful for determining the index of frame-by-frame~ +** Processing line: ~ sprite animation. The numeric value ~self~ represents the moment the~ +** Processing line: ~ animation started.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +This function is helpful for determining the index of frame-by-frame sprite animation. The numeric value ~self~ represents the moment the animation started. +** Processing line: ~~frame_index~ takes three additional parameters:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +~frame_index~ takes three additional parameters: +** Processing line: ~- How many frames exist in the sprite animation.~ +- Line was identified as a list. +*** True Line Result + +** Processing line: ~- How long to hold each animation for.~ +- Line was identified as a list. +*** True Line Result +- How many frames exist in the sprite animation. +** Processing line: ~- Whether the animation should repeat.~ +- Line was identified as a list. +*** True Line Result +- How long to hold each animation for. +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +- Whether the animation should repeat. +** Processing line: ~~frame_index~ will return ~nil~ if the time for the animation is out~ +** Processing line: ~of bounds of the parameter specification.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +~frame_index~ will return ~nil~ if the time for the animation is out of bounds of the parameter specification. +** Processing line: ~Example using variables:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Example using variables: +** 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_looping_at = 0~ +- Inside source: true +*** True Line Result + start_looping_at = 0 +** Processing line: ~ number_of_sprites = 6~ +- Inside source: true +*** True Line Result + number_of_sprites = 6 +** Processing line: ~ number_of_frames_to_show_each_sprite = 4~ +- Inside source: true +*** True Line Result + number_of_frames_to_show_each_sprite = 4 +** Processing line: ~ does_sprite_loop = true~ +- Inside source: true +*** True Line Result + does_sprite_loop = true +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ sprite_index =~ +- Inside source: true +*** True Line Result + sprite_index = +** Processing line: ~ start_looping_at.frame_index number_of_sprites,~ +- Inside source: true +*** True Line Result + start_looping_at.frame_index number_of_sprites, +** Processing line: ~ number_of_frames_to_show_each_sprite,~ +- Inside source: true +*** True Line Result + number_of_frames_to_show_each_sprite, +** Processing line: ~ does_sprite_loop~ +- Inside source: true +*** True Line Result + does_sprite_loop +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ sprite_index ||= 0~ +- Inside source: true +*** True Line Result + sprite_index ||= 0 +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ args.outputs.sprites << [~ +- Inside source: true +*** True Line Result + args.outputs.sprites << [ +** Processing line: ~ 640 - 50,~ +- Inside source: true +*** True Line Result + 640 - 50, +** Processing line: ~ 360 - 50,~ +- Inside source: true +*** True Line Result + 360 - 50, +** Processing line: ~ 100,~ +- Inside source: true +*** True Line Result + 100, +** Processing line: ~ 100,~ +- Inside source: true +*** True Line Result + 100, +** Processing line: ~ "sprites/dragon-#{sprite_index}.png"~ +- Inside source: true +*** True Line Result + "sprites/dragon-#{sprite_index}.png" +** 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: ~Example using named parameters:~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Example using named parameters: +** 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_looping_at = 0~ +- Inside source: true +*** True Line Result + start_looping_at = 0 +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ sprite_index =~ +- Inside source: true +*** True Line Result + sprite_index = +** Processing line: ~ start_looping_at.frame_index count: 6,~ +- Inside source: true +*** True Line Result + start_looping_at.frame_index count: 6, +** Processing line: ~ hold_for: 4,~ +- Inside source: true +*** True Line Result + hold_for: 4, +** Processing line: ~ repeat: true,~ +- Inside source: true +*** True Line Result + repeat: true, +** Processing line: ~ tick_count_override: args.state.tick_count~ +- Inside source: true +*** True Line Result + tick_count_override: args.state.tick_count +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ sprite_index ||= 0~ +- Inside source: true +*** True Line Result + sprite_index ||= 0 +** Processing line: ~~ +- Inside source: true +*** True Line Result + +** Processing line: ~ args.outputs.sprites << [~ +- Inside source: true +*** True Line Result + args.outputs.sprites << [ +** Processing line: ~ 640 - 50,~ +- Inside source: true +*** True Line Result + 640 - 50, +** Processing line: ~ 360 - 50,~ +- Inside source: true +*** True Line Result + 360 - 50, +** Processing line: ~ 100,~ +- Inside source: true +*** True Line Result + 100, +** Processing line: ~ 100,~ +- Inside source: true +*** True Line Result + 100, +** Processing line: ~ "sprites/dragon-#{sprite_index}.png"~ +- Inside source: true +*** True Line Result + "sprites/dragon-#{sprite_index}.png" +** 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: ~Kernel~~ +- Header detected. +*** True Line Result + +*** True Line Result +* DOCS: ~Kernel~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Kernel in the DragonRuby Runtime has patches for how standard out is handled and also~ +** Processing line: ~contains a unit of time in games called a tick.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +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. +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~* DOCS: ~Kernel::tick_count~~ +- Header detected. +*** True Line Result + +*** True Line Result +* DOCS: ~Kernel::tick_count~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Returns the current tick of the game. This value is reset if you call $gtk.reset.~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result +Returns the current tick of the game. This value is reset if you call $gtk.reset. +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~* DOCS: ~Kernel::global_tick_count~~ +- Header detected. +*** True Line Result + +*** True Line Result +* DOCS: ~Kernel::global_tick_count~ +** Processing line: ~~ +- End of paragraph detected. +*** True Line Result + +** Processing line: ~Returns the current tick of the application from the point it was started. This value is never reset.~ +* Processing Html Given True Lines +** Processing line: ~* DragonRuby Game Toolkit Live Docs~ +- Formatting line: ~DragonRuby Game Toolkit Live Docs~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H1 detected. +** 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. +- 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. +- 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. +- Formatting line: ~[[docs_search.gif]]~ +- Line's tilde count is: 0 +- Line contains link marker: true +- LINK detected. +** Processing line: ~~ +** Processing line: ~* Hello World~ +- Formatting line: ~Hello World~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H1 detected. +** Processing line: ~~ +** Processing line: ~Welcome to DragonRuby Game Toolkit. Take the steps below to get started.~ +- P detected. +- 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~ +- Formatting line: ~Join the Discord and Subscribe to the News Letter~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H1 detected. +** Processing line: ~~ +** Processing line: ~Our Discord channel is [[http://discord.dragonruby.org]].~ +- P detected. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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~ +- Formatting line: ~Watch Some Intro Videos~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H1 detected. +** 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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~ +- Formatting line: ~Getting Started Tutorial~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H1 detected. +** 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. +- 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~ +- Formatting line: ~Introduction~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H2 detected. +- Formatting line: ~Introduction~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~Welcome!~ +- P detected. +- 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. +- 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. +- 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. +- 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. +- 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~ +- Formatting line: ~Prerequisites~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H2 detected. +- 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. +- 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. +- 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~ +- Formatting line: ~The Game Loop~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H2 detected. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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~ +- Formatting line: ~Breakdown Of The ~tick~ Method~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +- H2 detected. +- 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. +- 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. +- 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~ +- Formatting line: ~Rendering A Sprite~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H2 detected. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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~ +- Formatting line: ~Coordinate System and Virtual Canvas~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H2 detected. +- 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. +- 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. +- 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. +- 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. +- 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~ +- Formatting line: ~Game State~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H2 detected. +- 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. +- 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: ~~args.state~ is a place you can hang your own data and have it survive past the life of the function call. 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. +- Formatting line: ~~args.state~ is a place you can hang your own data and have it survive past the life of the function call. 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: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~~ +** Processing line: ~** There Is No Delta Time~ +- Formatting line: ~There Is No Delta Time~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H2 detected. +- 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. +- 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. +- 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~ +- Formatting line: ~Handling User Input~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H2 detected. +- 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. +- 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. +- 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~ +- Formatting line: ~Coding On A Raspberry Pi~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H2 detected. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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~ +- Formatting line: ~Conclusion~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H2 detected. +- 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. +- 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!!~ +- Formatting line: ~IMPORTANT: Go Through All Of The Sample Apps! Study Them Thoroughly!!~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H2 detected. +- Formatting line: ~IMPORTANT: Go Through All Of The Sample Apps! Study Them Thoroughly!!~ +- 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. +- 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: ~1. 00_beginner_ruby_primer: This is an interactive tutorial that shows how to render ~solid~s, animated ~sprite~s, ~label~s.~ +- OL start detected. +- LI detected. +- Formatting line: ~ 00_beginner_ruby_primer: This is an interactive tutorial that shows how to render ~solid~s, animated ~sprite~s, ~label~s.~ +- Line's tilde count is: 6 +- Line contains link marker: false +- CODE detected. +** Processing line: ~2. 00_intermediate_ruby_primer: This is a set of sample Ruby snippets that give you a high level introduction to the programming language.~ +- LI detected. +- Formatting line: ~ 00_intermediate_ruby_primer: This is a set of sample Ruby snippets that give you a high level introduction to the programming language.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~3. 01_api_01_labels: Various ways to render ~label~s.~ +- LI detected. +- Formatting line: ~ 01_api_01_labels: Various ways to render ~label~s.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~4. 01_api_02_lines: Various ways to render ~line~s.~ +- LI detected. +- Formatting line: ~ 01_api_02_lines: Various ways to render ~line~s.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~5. 01_api_03_rects: Sample app shows various ways to render ~solid~s and ~border~s.~ +- LI detected. +- Formatting line: ~ 01_api_03_rects: Sample app shows various ways to render ~solid~s and ~border~s.~ +- Line's tilde count is: 4 +- Line contains link marker: false +- CODE detected. +** Processing line: ~6. 01_api_04_sprites: Sample app shows various ways to render ~sprite~s.~ +- LI detected. +- Formatting line: ~ 01_api_04_sprites: Sample app shows various ways to render ~sprite~s.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~7. 01_api_05_keyboard: Hows how to get keyboard input from the user.~ +- LI detected. +- Formatting line: ~ 01_api_05_keyboard: Hows how to get keyboard input from the user.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~8. 01_api_06_mouse: Hows how to get mouse mouse position.~ +- LI detected. +- Formatting line: ~ 01_api_06_mouse: Hows how to get mouse mouse position.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~9. 01_api_07_point_to_rect: How to get mouse input from the user and shows collision/hit detection.~ +- LI detected. +- Formatting line: ~ 01_api_07_point_to_rect: How to get mouse input from the user and shows collision/hit detection.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~10. 01_api_08_rect_to_rect: Hit detection/collision between two rectangles.~ +- LI detected. +- Formatting line: ~ 01_api_08_rect_to_rect: Hit detection/collision between two rectangles.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~11. 01_api_10_controller: Interaction with a USB/Bluetooth controller.~ +- LI detected. +- Formatting line: ~ 01_api_10_controller: Interaction with a USB/Bluetooth controller.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~12. 01_api_99_tech_demo: All the different render primitives along with using ~render_targets~.~ +- LI detected. +- Formatting line: ~ 01_api_99_tech_demo: All the different render primitives along with using ~render_targets~.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~13. 02_collision_01_simple: Collision detection with dynamically moving bodies.~ +- LI detected. +- Formatting line: ~ 02_collision_01_simple: Collision detection with dynamically moving bodies.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~14. 02_collision_02_moving_objects: Collision detection between many primitives, simple platformer physics, and keyboard input.~ +- LI detected. +- Formatting line: ~ 02_collision_02_moving_objects: Collision detection between many primitives, simple platformer physics, and keyboard input.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~15. 02_collision_03_entities: Collision with entities and serves as a small introduction to ECS (entity component system).~ +- LI detected. +- Formatting line: ~ 02_collision_03_entities: Collision with entities and serves as a small introduction to ECS (entity component system).~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~16. 02_collision_04_ramp_with_debugging: How ramp trajectory can be calculated.~ +- LI detected. +- Formatting line: ~ 02_collision_04_ramp_with_debugging: How ramp trajectory can be calculated.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~17. 02_collision_05_ramp_with_debugging_two: How ramp trajectory can be calculated.~ +- LI detected. +- Formatting line: ~ 02_collision_05_ramp_with_debugging_two: How ramp trajectory can be calculated.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~18. 02_sprite_animation_and_keyboard_input: How to animate a sprite based off of keyboard input.~ +- LI detected. +- Formatting line: ~ 02_sprite_animation_and_keyboard_input: How to animate a sprite based off of keyboard input.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~19. 03_mouse_click: How to determine what direction/vector a mouse was clicked relative to a player.~ +- LI detected. +- Formatting line: ~ 03_mouse_click: How to determine what direction/vector a mouse was clicked relative to a player.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~20. 04_sounds: How to play sounds and work with buttons.~ +- LI detected. +- Formatting line: ~ 04_sounds: How to play sounds and work with buttons.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~21. 05_mouse_move: How to determine what direction/vector a mouse was clicked relative to a player.~ +- LI detected. +- Formatting line: ~ 05_mouse_move: How to determine what direction/vector a mouse was clicked relative to a player.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~22. 05_mouse_move_paint_app: Represents a simple paint app.~ +- LI detected. +- Formatting line: ~ 05_mouse_move_paint_app: Represents a simple paint app.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~23. 05_mouse_move_tile_editor: A starting point for a tile editor.~ +- LI detected. +- Formatting line: ~ 05_mouse_move_tile_editor: A starting point for a tile editor.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~24. 06_coordinate_systems: Shows the two origin systems within Game Toolkit where the origin is in the center and where the origin is at the bottom left.~ +- LI detected. +- Formatting line: ~ 06_coordinate_systems: Shows the two origin systems within Game Toolkit where the origin is in the center and where the origin is at the bottom left.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~25. 07_render_targets: Shows a powerful concept called ~render_target~s. You can use this to programatically create sprites (it's also useful for representing parts of a scene as if it was a view port/camera).~ +- LI detected. +- Formatting line: ~ 07_render_targets: Shows a powerful concept called ~render_target~s. You can use this to programatically create sprites (it's also useful for representing parts of a scene as if it was a view port/camera).~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~26. 07_render_targets_advanced: Advanced usage of ~render_target~s.~ +- LI detected. +- Formatting line: ~ 07_render_targets_advanced: Advanced usage of ~render_target~s.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~27. 08_platformer_collisions: Axis aligned collision along with platformer physics.~ +- LI detected. +- Formatting line: ~ 08_platformer_collisions: Axis aligned collision along with platformer physics.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~28. 08_platformer_collisions_metroidvania: How to save map data and place sprites live within a game.~ +- LI detected. +- Formatting line: ~ 08_platformer_collisions_metroidvania: How to save map data and place sprites live within a game.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~29. 08_platformer_jumping_inertia: Jump physics and how inertia affects collision.~ +- LI detected. +- Formatting line: ~ 08_platformer_jumping_inertia: Jump physics and how inertia affects collision.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~30. 09_controller_analog_usage_advanced_sprites: Extended properties of a ~sprite~ and how to change the rotation anchor point and render a subset/tile of a sprite.~ +- LI detected. +- Formatting line: ~ 09_controller_analog_usage_advanced_sprites: Extended properties of a ~sprite~ and how to change the rotation anchor point and render a subset/tile of a sprite.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~31. 09_sprite_animation_using_tile_sheet: How to perform sprite animates using a tile sheet.~ +- LI detected. +- Formatting line: ~ 09_sprite_animation_using_tile_sheet: How to perform sprite animates using a tile sheet.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~32. 10_save_load_game: Save and load game data.~ +- LI detected. +- Formatting line: ~ 10_save_load_game: Save and load game data.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~33. 11_coersion_of_primitives: How primitives of one specific type can be rendered as another primitive type.~ +- LI detected. +- Formatting line: ~ 11_coersion_of_primitives: How primitives of one specific type can be rendered as another primitive type.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~34. 11_hash_primitives: How primitives can be represented using a ~Hash~.~ +- LI detected. +- Formatting line: ~ 11_hash_primitives: How primitives can be represented using a ~Hash~.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~35. 12_controller_input_sprite_sheet_animations: How to leverage vectors to move a player around the screen.~ +- LI detected. +- Formatting line: ~ 12_controller_input_sprite_sheet_animations: How to leverage vectors to move a player around the screen.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~36. 12_top_down_area: How to render a top down map and how to manage collision of a player.~ +- LI detected. +- Formatting line: ~ 12_top_down_area: How to render a top down map and how to manage collision of a player.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~37. 13_01_easing_functions: How to use lerping functions to define animations/movement.~ +- LI detected. +- Formatting line: ~ 13_01_easing_functions: How to use lerping functions to define animations/movement.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~38. 13_02_cubic_bezier: How to create a bezier curve using lines.~ +- LI detected. +- Formatting line: ~ 13_02_cubic_bezier: How to create a bezier curve using lines.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~39. 13_03_easing_using_spline: How a collection of bezier curves can be used to define an animation.~ +- LI detected. +- Formatting line: ~ 13_03_easing_using_spline: How a collection of bezier curves can be used to define an animation.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~40. 13_04_parametric_enemy_movement: How to define the movement of enemies and projectiles using lerping/parametric functions.~ +- LI detected. +- Formatting line: ~ 13_04_parametric_enemy_movement: How to define the movement of enemies and projectiles using lerping/parametric functions.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~41. 14_sprite_limits: Upper limit for how many sprites can be rendered to the screen.~ +- LI detected. +- Formatting line: ~ 14_sprite_limits: Upper limit for how many sprites can be rendered to the screen.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~42. 14_sprite_limits_static_references: Upper limit for how many sprites can be rendered to the screen using ~static~ output collections (which are updated by reference as opposed to by value).~ +- LI detected. +- Formatting line: ~ 14_sprite_limits_static_references: Upper limit for how many sprites can be rendered to the screen using ~static~ output collections (which are updated by reference as opposed to by value).~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~43. 15_collision_limits: How many collisions can be processed across many primitives.~ +- LI detected. +- Formatting line: ~ 15_collision_limits: How many collisions can be processed across many primitives.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~44. 18_moddable_game: How you can make a game where content is authored by the player (modding support).~ +- LI detected. +- Formatting line: ~ 18_moddable_game: How you can make a game where content is authored by the player (modding support).~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~45. 19_lowrez_jam_01_hello_world: How to use ~render_targets~ to create a low resolution game.~ +- LI detected. +- Formatting line: ~ 19_lowrez_jam_01_hello_world: How to use ~render_targets~ to create a low resolution game.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~46. 19_lowrez_jam_02_buttons: How to use ~render_targets~ to create a low resolution game.~ +- LI detected. +- Formatting line: ~ 19_lowrez_jam_02_buttons: How to use ~render_targets~ to create a low resolution game.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~47. 19_lowrez_jam_03_space_shooter: How to use ~render_targets~ to create a low resolution game.~ +- LI detected. +- Formatting line: ~ 19_lowrez_jam_03_space_shooter: How to use ~render_targets~ to create a low resolution game.~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +** Processing line: ~48. 20_roguelike_starting_point: A starting point for a roguelike and explores concepts such as line of sight.~ +- LI detected. +- Formatting line: ~ 20_roguelike_starting_point: A starting point for a roguelike and explores concepts such as line of sight.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~49. 20_roguelike_starting_point_two: A starting point for a roguelike where sprites are provided from a tile map/tile sheet.~ +- LI detected. +- Formatting line: ~ 20_roguelike_starting_point_two: A starting point for a roguelike where sprites are provided from a tile map/tile sheet.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~50. 21_mailbox_usage: How to do interprocess communication.~ +- LI detected. +- Formatting line: ~ 21_mailbox_usage: How to do interprocess communication.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~51. 22_trace_debugging: Debugging techniques and tracing execution through your game.~ +- LI detected. +- Formatting line: ~ 22_trace_debugging: Debugging techniques and tracing execution through your game.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~52. 22_trace_debugging_classes: Debugging techniques and tracing execution through your game.~ +- LI detected. +- Formatting line: ~ 22_trace_debugging_classes: Debugging techniques and tracing execution through your game.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~53. 23_hexagonal_grid: How to make a tactical grid/map made of hexagons.~ +- LI detected. +- Formatting line: ~ 23_hexagonal_grid: How to make a tactical grid/map made of hexagons.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~54. 23_isometric_grid: How to make a tactical grid/map made of isometric sprites.~ +- LI detected. +- Formatting line: ~ 23_isometric_grid: How to make a tactical grid/map made of isometric sprites.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~55. 24_http_example: How to make http requests.~ +- LI detected. +- Formatting line: ~ 24_http_example: How to make http requests.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~56. 25_3d_experiment_01_square: How to create 3D objects.~ +- LI detected. +- Formatting line: ~ 25_3d_experiment_01_square: How to create 3D objects.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~57. 26_jam_craft: Starting point for crafting game. It also shows how to customize the mouse cursor.~ +- LI detected. +- Formatting line: ~ 26_jam_craft: Starting point for crafting game. It also shows how to customize the mouse cursor.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~58. 99_sample_game_basic_gorillas: Reference implementation of a full game. Topics covered: physics, keyboard input, collision, sprite animation.~ +- LI detected. +- Formatting line: ~ 99_sample_game_basic_gorillas: Reference implementation of a full game. Topics covered: physics, keyboard input, collision, sprite animation.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~59. 99_sample_game_clepto_frog: Reference implementation of a full game. Topics covered: camera control, spring/rope physics, scene orchestration.~ +- LI detected. +- Formatting line: ~ 99_sample_game_clepto_frog: Reference implementation of a full game. Topics covered: camera control, spring/rope physics, scene orchestration.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~60. 99_sample_game_dueling_starships: Reference implementation that shows local multiplayer. Topics covered: vectors, particles, friction, inertia.~ +- LI detected. +- Formatting line: ~ 99_sample_game_dueling_starships: Reference implementation that shows local multiplayer. Topics covered: vectors, particles, friction, inertia.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~61. 99_sample_game_flappy_dragon: Reference implementation that is a clone of Flappy Bird. Topics covered: scene orchestration, collision, sound, sprite animations, lerping.~ +- LI detected. +- Formatting line: ~ 99_sample_game_flappy_dragon: Reference implementation that is a clone of Flappy Bird. Topics covered: scene orchestration, collision, sound, sprite animations, lerping.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~62. 99_sample_game_pong: Reference implementation of pong.~ +- LI detected. +- Formatting line: ~ 99_sample_game_pong: Reference implementation of pong.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~63. 99_sample_game_return_of_serenity: Reference implementation of low resolution story based game.~ +- LI detected. +- Formatting line: ~ 99_sample_game_return_of_serenity: Reference implementation of low resolution story based game.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~64. 99_sample_game_the_little_probe: Reference implementation of a full game. Topics covered: Arbitrary collision detection, loading map data, bounce/ball physics.~ +- LI detected. +- Formatting line: ~ 99_sample_game_the_little_probe: Reference implementation of a full game. Topics covered: Arbitrary collision detection, loading map data, bounce/ball physics.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~65. 99_sample_nddnug_workshop: Reference implementation of a full game. Topics covered: vectors, controller input, sound, trig functions.~ +- LI detected. +- Formatting line: ~ 99_sample_nddnug_workshop: Reference implementation of a full game. Topics covered: vectors, controller input, sound, trig functions.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~66. 99_sample_snakemoji: Shows that Ruby supports coding with emojis.~ +- LI detected. +- Formatting line: ~ 99_sample_snakemoji: Shows that Ruby supports coding with emojis.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~67. 99_zz_gtk_unit_tests: A collection of unit tests that exercise parts of DragonRuby's API.~ +- LI detected. +- Formatting line: ~ 99_zz_gtk_unit_tests: A collection of unit tests that exercise parts of DragonRuby's API.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~* Deploying To Itch.io~ +- Formatting line: ~Deploying To Itch.io~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H1 detected. +** 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. +- 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~ +- Formatting line: ~Creating Your Game Landing Page~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H2 detected. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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~ +- Formatting line: ~Update Your Game's Metadata~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H2 detected. +- 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. +- 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. +- 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. +- 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~ +- Formatting line: ~Building Your Game For Distribution~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H2 detected. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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: ~** DragonRuby's Philosophy~ +- Formatting line: ~DragonRuby's Philosophy~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H2 detected. +- 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. +- 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~ +- Formatting line: ~Challenge The Status Quo~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H3 detected. +- 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. +- 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. +- 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. +- 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: ~*** Release Often And Quickly~ +- Formatting line: ~Release Often And Quickly~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H3 detected. +- Formatting line: ~Release Often And Quickly~ +- 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 quickly.~ +- P detected. +- 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. +- 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. +- Formatting line: ~Remember:~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~#+begin_quote~ +- BLOCKQUOTE start detected. +** Processing line: ~Real artists ship.~ +- P detected. +- 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: ~~ +** Processing line: ~~ +** Processing line: ~*** Sustainable And Ethical Monetization~ +- Formatting line: ~Sustainable And Ethical Monetization~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H3 detected. +- 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. +- 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. +- 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: ~~ +** Processing line: ~*** Sustainable And Ethical Open Source~ +- Formatting line: ~Sustainable And Ethical Open Source~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H3 detected. +- 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. +- 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. +- 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~ +- Formatting line: ~People Over Entities~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H3 detected. +- 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. +- 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~ +- Formatting line: ~Building A Game Should Be Fun And Bring Happiness~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H3 detected. +- 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. +- 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~ +- Formatting line: ~Real World Application Drives Features~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H3 detected. +- 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. +- 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. +- 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: ~* How To Determine What Frame You Are On~ +- Formatting line: ~How To Determine What Frame You Are On~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H1 detected. +** 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. +- 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~ +- Formatting line: ~How To Get Current Framerate~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H1 detected. +** 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. +- 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~ +- Formatting line: ~How To Render A Sprite Using An Array~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H1 detected. +** 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. +- 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. +- 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. +- 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~ +- Formatting line: ~More Sprite Properties As An Array~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H1 detected. +** Processing line: ~~ +** Processing line: ~Here are all the properties you can set on a sprite.~ +- P detected. +- 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~ +- Formatting line: ~Different Sprite Representations~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H1 detected. +** Processing line: ~~ +** Processing line: ~Using ordinal positioning can get a little unruly given so many properties you have control over.~ +- P detected. +- 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. +- 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. +- 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~ +- Formatting line: ~How To Render A Label~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H1 detected. +** Processing line: ~~ +** Processing line: ~~args.outputs.labels~ is used to render labels.~ +- P detected. +- 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. +- 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. +- 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~ +- Formatting line: ~A Colored Label~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H1 detected. +** 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~ +- Formatting line: ~Extended Label Properties~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H1 detected. +** 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. +- 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. +- 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~~ +- Formatting line: ~Rendering A Label As A ~Hash~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +- H1 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. +- 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~ +- Formatting line: ~Getting The Size Of A Piece Of Text~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H1 detected. +** Processing line: ~~ +** Processing line: ~You can get the render size of any string using ~args.gtk.calcstringbox~.~ +- P detected. +- 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~ +- Formatting line: ~How To Play A Sound~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H1 detected. +** Processing line: ~~ +** Processing line: ~Sounds that end ~.wav~ will play once:~ +- P detected. +- 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. +- 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. +- 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~ +- Formatting line: ~Using ~args.state~ To Store Your Game State~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +- H1 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. +- 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. +- 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. +- 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.player.x ||= 0~ +** Processing line: ~ args.player.y ||= 0~ +** Processing line: ~ args.player.hp ||= 100~ +** Processing line: ~~ +** Processing line: ~ # increment the x position of the character by one every frame~ +** Processing line: ~ args.player.x += 1~ +** Processing line: ~~ +** Processing line: ~ # Render a sprite with a label above the sprite~ +** Processing line: ~ args.outputs.sprites << [~ +** Processing line: ~ args.player.x,~ +** Processing line: ~ args.player.y,~ +** Processing line: ~ 32, 32,~ +** Processing line: ~ "player.png"~ +** Processing line: ~ ]~ +** Processing line: ~~ +** Processing line: ~ args.outputs.labels << [~ +** Processing line: ~ args.player.x,~ +** Processing line: ~ args.player.y - 50,~ +** Processing line: ~ args.player.hp~ +** Processing line: ~ ]~ +** Processing line: ~ end~ +** Processing line: ~#+end_src~ +- PRE end detected. +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~* Frequently Asked Questions, Comments, and Concerns~ +- Formatting line: ~Frequently Asked Questions, Comments, and Concerns~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H1 detected. +** Processing line: ~~ +** Processing line: ~Here are questions, comments, and concerns that frequently come up.~ +- P detected. +- 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~ +- Formatting line: ~Frequently Asked Questions~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H2 detected. +- 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?~ +- Formatting line: ~What is DragonRuby LLP?~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H3 detected. +- 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. +- 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. +- 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. [Home Page]() [FAQ Page]()~ +- UL start detected. +- LI detected. +- Formatting line: ~Game Toolkit (GTK): A 2D game engine that is compatible with modern + gaming platforms. [Home Page]() [FAQ Page]()~ +- 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. [Home Page]() [FAQ Page]()~ +- LI detected. +- Formatting line: ~RubyMotion (RM): A compiler toolchain that allows you to build native, cross-platform mobile + apps. [Home Page]() [FAQ Page]()~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~- Commandline Toolkit (CTK): A zero dependency, zero installation Ruby + environment that works on Windows, Mac, and Linux. [Home Page]() [FAQ Page]()~ +- LI detected. +- Formatting line: ~Commandline Toolkit (CTK): A zero dependency, zero installation Ruby + environment that works on Windows, Mac, and Linux. [Home Page]() [FAQ Page]()~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~All of the products above leverage a shared core called DragonRuby.~ +- UL end detected. +- P detected. +- 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. +- 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. +- 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. +- 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?~ +- Formatting line: ~What is DragonRuby?~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H3 detected. +- 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. +- 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?~ +- 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 +- H3 detected. +- 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 langauge specification. When people say "Ruby," they are usually referring to "the Ruby 3.0+ language specification implemented via the CRuby/MRI Runtime."~ +- P detected. +- Formatting line: ~A runtime is an _implementation_ of a langauge 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. +- 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?~ +- Formatting line: ~Okay... what language specification does DragonRuby use then?~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H3 detected. +- 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. +- 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?~ +- Formatting line: ~So... why another runtime?~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H3 detected. +- 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. +- 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. +- 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?~ +- Formatting line: ~What does Multilevel Cross-platform mean?~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H3 detected. +- 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. +- 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. +- 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. +- 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. +- 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 implemenations (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. +- Formatting line: ~Levels 1 through 3 are fairly commonplace in many runtime implemenations (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 lowlevel multimedia component library that has been in active development for 22 years and counting).~ +- UL start detected. +- LI detected. +- 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 lowlevel 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 codegeneration layer which creates metadata that allows + for native interopability with host runtime libraries. It also includes OS specific message pump orchestrations.~ +- LI detected. +- Formatting line: ~Level 5 is a codegeneration layer which creates metadata that allows + for native interopability 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. +- 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 seperation between these two worlds; and provides a means to add new platforms without going insane.~ +- UL end detected. +- P detected. +- 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 seperation 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?~ +- 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 +- H3 detected. +- 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 implentation 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. +- Formatting line: ~DragonRuby is a Ruby runtime implentation 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: ~** Frequent Comments~ +- Formatting line: ~Frequent Comments~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H2 detected. +- Formatting line: ~Frequent Comments~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~~ +** Processing line: ~*** But Ruby is dead.~ +- Formatting line: ~But Ruby is dead.~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H3 detected. +- 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. +- 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. +- 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. +- 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. +- 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.~ +- Formatting line: ~But Ruby is slow.~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H3 detected. +- 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. +- 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 langauges are slow.~ +- Formatting line: ~Dynamic langauges are slow.~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H3 detected. +- Formatting line: ~Dynamic langauges 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. +- 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 langauge 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. +- Formatting line: ~Unless you are writing in some form of intermediate representation by hand, your langauge 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 skillset. Email us ^_^.~ +- P detected. +- Formatting line: ~NOTE: If you _are_ hand writing LLVM IR, we are always open to bringing on new partners with such a skillset. Email us ^_^.~ +- Line's tilde count is: 0 +- Line contains link marker: false +** Processing line: ~~ +** Processing line: ~** Frequent Concerns~ +- Formatting line: ~Frequent Concerns~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H2 detected. +- 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.~ +- Formatting line: ~DragonRuby is not open source. That's not right.~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H3 detected. +- 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 serverly understaffed, and burnout from core members is rampant.~ +- P detected. +- Formatting line: ~The current state of open source is unsustainable. Contributors work for free, most all open source repositories are serverly understaffed, 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 infact, 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. +- Formatting line: ~We believe in open source very strongly. Parts of DragonRuby are infact, 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. +- 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. +- 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: ~~ +** Processing line: ~*** DragonRuby is for pay. You should offer a free version.~ +- Formatting line: ~DragonRuby is for pay. You should offer a free version.~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H3 detected. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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 [email protected] with a short explanation of your current situation and he'll set you up. No questions asked.~ +- UL end detected. +- P detected. +- Formatting line: ~Just contact Amir at [email protected] 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.~ +- 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 +- H3 detected. +- 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. +- 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. +- 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.~ +- 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 +- H3 detected. +- 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. +- 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 peiple 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. +- Formatting line: ~The peiple 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.~ +- 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 +- H3 detected. +- 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. +- 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 partnershiop bylaws state that _all_ DragonRuby IP that can be legally open sourced, will be released under a permissive license.~ +- P detected. +- Formatting line: ~But, in the event that sad day comes, our partnershiop 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: ~* DOCS: ~GTK::Runtime~~ +- Formatting line: ~~GTK::Runtime~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +- H1 detected. +** Processing line: ~The GTK::Runtime class is the core of DragonRuby. It is globally accessible via ~$gtk~.~ +- P detected. +- 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: ~* DOCS: ~GTK::Runtime#calcstringbox~~ +- Formatting line: ~~GTK::Runtime#calcstringbox~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +- H1 detected. +** Processing line: ~This function returns the width and height of a string.~ +- P detected. +- 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#reset~~ +- Formatting line: ~~GTK::Runtime#reset~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +- H1 detected. +** Processing line: ~This function will reset Kernel.tick_count to 0 and will remove all data from args.state.~ +- P detected. +- 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: ~Array~~ +- Formatting line: ~~Array~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +- H1 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. +- 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~~ +- Formatting line: ~~Array#map~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +- H1 detected. +** Processing line: ~~ +** Processing line: ~The function given a block returns a new ~Enumerable~ of values.~ +- P detected. +- 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. +- 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~~ +- Formatting line: ~~Array#each~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +- H1 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. +- 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. +- 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~~ +- Formatting line: ~~Array#reject_nil~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +- H1 detected. +** Processing line: ~~ +** Processing line: ~Returns an ~Enumerable~ rejecting items that are ~nil~, this is an alias for ~Array#compact~:~ +- P detected. +- 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~~ +- Formatting line: ~~Array#reject_false~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +- H1 detected. +** Processing line: ~~ +** Processing line: ~Returns an `Enumerable` rejecting items that are `nil` or `false`.~ +- P detected. +- 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~~ +- Formatting line: ~~Array#product~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +- H1 detected. +** Processing line: ~~ +** Processing line: ~Returns all combinations of values between two arrays.~ +- P detected. +- 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. +- 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~~ +- Formatting line: ~~Array#map_2d~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +- H1 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. +- 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?~~ +- Formatting line: ~~Array#include_any?~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +- H1 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. +- 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?~~ +- Formatting line: ~~Array#any_intersect_rect?~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +- H1 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. +- 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. +- 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::Outputs~~ +- Formatting line: ~~GTK::Outputs~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +- H1 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. +- 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#borders~~ +- Formatting line: ~~GTK::Outputs#borders~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +- H1 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. +- 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. +- 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. +- 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. +- 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#solids~~ +- Formatting line: ~~GTK::Outputs#solids~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +- H1 detected. +** Processing line: ~~ +** Processing line: ~Add primitives to this collection to render a solid to the screen.~ +- P detected. +- 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~ +- Formatting line: ~Rendering a solid using an Array~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H2 detected. +- 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. +- 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~ +- Formatting line: ~Rendering a solid using an Array with colors and alpha~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H2 detected. +- 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. +- 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. +- 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~ +- Formatting line: ~Rendering a solid using a Hash~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H2 detected. +- 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. +- 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~ +- Formatting line: ~Rendering a solid using a Class~ +- Line's tilde count is: 0 +- Line contains link marker: false +- H2 detected. +- 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. +- 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. +- 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::Mouse~~ +- Formatting line: ~~GTK::Mouse~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +- H1 detected. +** Processing line: ~~ +** Processing line: ~The mouse is accessible via ~args.inputs.mouse~:~ +- P detected. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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~~ +- Formatting line: ~~GTK::MousePoint~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +- H1 detected. +** Processing line: ~~ +** Processing line: ~The ~GTK::MousePoint~ has the following properties.~ +- P detected. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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~~ +- Formatting line: ~~GTK::OpenEntity~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +- H1 detected. +** Processing line: ~~ +** Processing line: ~~GTK::OpenEntity~ is accessible within the DragonRuby's top level ~tick~ function via the ~args.state~ property.~ +- P detected. +- 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. +- 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. +- 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~~ +- Formatting line: ~~GTK::OpenEntity#as_hash~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +- H1 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. +- 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. +- 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~~ +- Formatting line: ~~Numeric#frame_index~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +- H1 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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. +- 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: ~Kernel~~ +- Formatting line: ~~Kernel~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +- H1 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. +- 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~~ +- Formatting line: ~~Kernel::tick_count~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +- H1 detected. +** Processing line: ~~ +** Processing line: ~Returns the current tick of the game. This value is reset if you call $gtk.reset.~ +- P detected. +- 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~~ +- Formatting line: ~~Kernel::global_tick_count~~ +- Line's tilde count is: 2 +- Line contains link marker: false +- CODE detected. +- H1 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. +- 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
\ No newline at end of file diff --git a/docs/search_results.txt b/docs/search_results.txt new file mode 100644 index 0000000..b4c5e12 --- /dev/null +++ b/docs/search_results.txt @@ -0,0 +1,63 @@ +* DOCS: ~Numeric#frame_index~ + +This function is helpful for determining the index of frame-by-frame + sprite animation. The numeric value ~self~ represents the moment the + animation started. + +~frame_index~ takes three additional parameters: + +- How many frames exist in the sprite animation. +- How long to hold each animation for. +- Whether the animation should repeat. + +~frame_index~ will return ~nil~ if the time for the animation is out +of bounds of the parameter specification. + +Example using variables: + +#+begin_src ruby + def tick args + start_looping_at = 0 + number_of_sprites = 6 + number_of_frames_to_show_each_sprite = 4 + does_sprite_loop = true + + sprite_index = + start_looping_at.frame_index number_of_sprites, + number_of_frames_to_show_each_sprite, + does_sprite_loop + + sprite_index ||= 0 + + args.outputs.sprites << [ + 640 - 50, + 360 - 50, + 100, + 100, + "sprites/dragon-#{sprite_index}.png" + ] + end +#+end_src + +Example using named parameters: + +#+begin_src ruby + start_looping_at = 0 + + sprite_index = + start_looping_at.frame_index count: 6, + hold_for: 4, + repeat: true + + sprite_index ||= 0 + + args.outputs.sprites << [ + 640 - 50, + 360 - 50, + 100, + 100, + "sprites/dragon-#{sprite_index}.png" + ] +#+end_src + + diff --git a/docs/todo/03-solids-and-borders.md b/docs/todo/03-solids-and-borders.md new file mode 100644 index 0000000..0ed2fc9 --- /dev/null +++ b/docs/todo/03-solids-and-borders.md @@ -0,0 +1,126 @@ +# Solids and Borders + +Solids and Borders are great to use as place holders for sprites. + +## Sample Apps Releated to Solid/Borders Usage (ordered by size of codebase increasing) + +- 01_api_03_rects +- 01_api_99_tech_demo (includes recording) +- 02_collisions +- 12_top_down_area (includes recording) +- 99_sample_game_flappy_dragon (includes recording) +- 08_platformer_collisions +- 20_roguelike_starting_point +- 99_sample_game_pong (includes recording) + +## Minimum Code + +Creates a solid black rectangle located at 100, 100. 160 pixels +wide and 90 pixels tall. + +```ruby +# X Y WIDTH HEIGHT +args.outputs.solids << [100, 100, 160, 90] +``` + +Creates an unfilled black-bordered rectangle located at 100, 100. +160 pixels wide and 90 pixels tall. + +```ruby +# X Y WIDTH HEIGHT +args.outputs.borders << [100, 100, 160, 90] +``` + +## RGBA - Colors and Alpha + +The value for the color and alpha is an number between `0` and `255`. The +alpha property is optional and will be set to `255` if not specified. + +Creates a green solid rectangle with an opacity of 50%. + +```ruby +# X Y WIDTH HEIGHT RED GREEN BLUE ALPHA +args.outputs.solids << [100, 100, 160, 90, 0, 255, 0, 128] +``` + +Creates an unfilled green-bordered rectangle located at 100, 100. +160 pixels wide and 90 pixels tall and an opacity of 50%. + +```ruby +# X Y WIDTH HEIGHT RED GREEN BLUE ALPHA +args.outputs.borders << [100, 100, 160, 90, 0, 255, 0, 128] +``` + +Creates a solid gray rectangle that covers the entire scene. Like a background. +The opacity is excluded because it's 100% opaque (which has a value of 255). + +```ruby +# X Y WIDTH HEIGHT RED GREEN BLUE +args.outputs.solids << [ 0, 0, 1280, 720, 128, 128, 128] +``` + +## Hash (Advanced) + +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. + +```ruby +args.outputs.solids << { + x: 0, + y: 0, + w: 100, + h: 100, + r: 0, + g: 255, + b: 0, + a: 255 +} + + +args.outputs.borders << { + x: 0, + y: 0, + w: 100, + h: 100, + r: 0, + g: 255, + b: 0, + a: 255 +} +``` + +## Duck Typing (Advanced) + +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. + +Here is an example: + +```ruby +# Create type with ALL solid/border properties AND primitive_marker +class Solid (or Border) + attr_accessor :x, :y, :w, :h, :r, :g, :b, :a_x + + def primitive_marker + :solid (or :border) + end +end + +# Inherit from type +class Square < Solid (or Border) + # constructor + def initialize x, y, size + self.x = x + self.y = y + self.w = size + self.h = size + end +end + +# render solid/border + +args.outputs.solids << Square.new(10, 10, 32) +args.outputs.borders << Square.new(10, 10, 32) +``` diff --git a/docs/todo/04-lines.md b/docs/todo/04-lines.md new file mode 100644 index 0000000..03c1abc --- /dev/null +++ b/docs/todo/04-lines.md @@ -0,0 +1,108 @@ +# Lines + +Lines are 1 pixel wide and can be diagonal. + +## Sample Apps Related to Line Usage (ordered by size of codebase increasing) + +- 01_api_02_lines +- 01_api_99_tech_demo (includes recording) +- 06_coordinate_systems (includes recording) +- 19_lowrez_jam_01_hello_world +- 99_sample_game_pong (includes recording) + +## Minimum Code + +Creates a black line from the bottom left corner to the top right corner. + +```ruby +# X1 Y1 X2 Y2 +args.outputs.lines << [ 0, 0, 1280, 720] +``` + +Creates a black vertical line through the center of the scene. + +```ruby +# X1 Y1 X2 Y2 +args.outputs.lines << [ 640, 0, 640, 720] +``` + +Creates a black horizontal line through the center of the scene. + +```ruby +# X1 Y1 X2 Y2 +args.outputs.lines << [ 0, 360, 1280, 360] +``` + +## RGBA - Colors and Alpha + +The value for the color and alpha is an number between `0` and `255`. The +alpha property is optional and will be set to `255` if not specified. + +Creates a green horizontal line through the center of the scene with an opacity of 50%. + +```ruby +# X1 Y1 X2 Y2 RED GREEN BLUE ALPHA +args.outputs.lines << [ 0, 360, 1280, 360, 0, 255, 0, 128] +``` + +Creates a green vertical line through the center of the scene. +The opacity is excluded because it's 100% opaque (which has a value of 255). + +```ruby +# X1 Y1 X2 Y2 RED GREEN BLUE +args.outputs.lines << [ 640, 0, 640, 720, 0, 255, 0] +``` + +## Hash (Advanced) + +If you want a more readable invocation. You can use the following hash to create a line. +Any parameters that are not specified will be given a default value. The keys of the hash can +be provided in any order. + +```ruby +args.outputs.lines << { + x: 0, + y: 0, + x2: 1280, + y2: 720, + r: 0, + g: 255, + b: 0, + a: 255 +} +``` + +## Duck Typing (Advanced) + +You can also create a class with line properties and render it as a primitive. +ALL properties must on the class. ADDITIONALLY, a method called `primitive_marker` +must be defined on the class. + +Here is an example: + +```ruby +# Create type with ALL line properties AND primitive_marker +class Line + attr_accessor :x, :y, :x2, :y2, :r, :g, :b, :a + + def primitive_marker + :line + end +end + +# Inherit from type +class VerticalLine < Line + + # constructor + def initialize x, y, h + self.x = x + self.y = y + self.x2 = x + self.y2 = y + h + end +end + +# render line + +args.outputs.lines << VerticalLine.new(10, 10, 100) +``` diff --git a/docs/todo/05-sprites.md b/docs/todo/05-sprites.md new file mode 100644 index 0000000..e8030ab --- /dev/null +++ b/docs/todo/05-sprites.md @@ -0,0 +1,216 @@ +# Sprites + +Sprites are the most important visual component of a game. + +## Sample Apps Related to Sprite Usage (ordered by size of codebase increasing) + +- 01_api_04_sprites +- 01_api_99_tech_demo (includes recording) +- 02_sprite_animation_and_keyboard_input (includes recording) +- 08_platformer_collisions_metroidvania +- 09_controller_analog_usage_advanced_sprites +- 99_sample_game_basic_gorillas (includes recording) +- 99_sample_game_dueling_starships (includes recording) +- 99_sample_game_flappy_dragon (includes recording) +- 99_sample_game_return_of_serenity + +## Minimum Code + +Sprites need to be under the `mygame` directory. It's recommended that you create a `sprites` folder +to keep things organized. All sprites must be `.png` files + +Here is how you create an sprite with located at 100, 100, that is 32 pixels wide and 64 pixels tall. +In this example the sprite name is `player.png` and is located under a directory `mygame/sprites`. + +```ruby +# X Y WIDTH HEIGHT PATH +args.outputs.sprites << [100, 100, 32, 64, "sprites/player.png"] +``` + +## Rotation / Angle + +Unlike `solids` and `borders`, sprites can be rotated. This is how you rotate a sprite 90 degress. + +Note: All angles in DragonRuby Game Toolkit are represented in degrees (not radians). + +```ruby +# X Y WIDTH HEIGHT PATH ANGLE +args.outputs.sprites << [100, 100, 32, 64, "sprites/player.png", 90] +``` + +## Alpha + +Sprites can also have a transparency associated with them. The transparency value must come after +the angle value and supports a number between 0 and 255. + +This is how you would define a sprite with no rotation, and a 50% transparency. + +```ruby +# X Y WIDTH HEIGHT PATH ANGLE ALPHA +args.outputs.sprites << [100, 100, 32, 64, "sprites/player.png", 0, 128] +``` + +## Color Saturations + +A Sprite's color levels can be changed. The color saturations must come after `angle` and +`alpha` values. + +This is a sprite with no rotation, fully opaque, and with a green tint. + +```ruby +args.outputs.sprites << [100, # X + 100, # Y + 32, # W + 64, # H + "sprites/player.png", # PATH + 0, # ANGLE + 255, # ALPHA + 0, # RED_SATURATION + 255, # GREEN_SATURATION + 0] # BLUE_SATURATION +``` + +## Sprite Sub Division / Tile + +You can render a portion of a sprite (a tile). The sub division of the sprite is denoted as a rectangle +directly related to the original size of the png. + +This is a sprite scaled to 100 pixels where the source rectangle is located at the bottom left corner +within a 32 pixel square. The angle, opacity, and color levels of the tile are unaltered. + +**For these advanced transforms, you should use a `Hash` instead of an `Array`.** + +```ruby +args.outputs.sprites << { + x: 100, + y: 100, + w: 100, + h: 100, + path: "sprites/player.png", + source_x: 0, + source_y: 0, + source_w: 32, + source_h: 32, +} +``` + +## Flipping a Sprite Horizontally and Vertically + +A sprite can be flipped horizontally and vertically. + +This is a sprite that has been flipped horizontally. The sprites's angle, alpha, color saturations, +and source rectangls are unaltered. + +**For these advanced transforms, you should use a `Hash` instead of an `Array`.** + +```ruby +args.outputs.sprites << { + x: 100, + y: 100, + w: 100, + h: 100, + path: "sprites/player.png", + flip_horizontally: true, +} +``` + +This is a sprite that has been flipped vertically. The sprites's angle, alpha, color saturations, +and tile subdivision are unaltered. + +```ruby +args.outputs.sprites << { + x: 100, + y: 100, + w: 100, + h: 100, + path: "sprites/player.png", + flip_vertically: true, +} +``` + +## Rotation Center + +A sprites center of rotation can be altered. + +This is a sprite that has its rotation center set to the top-middle. The sprites's angle, alpha, color saturations, +source rectangle subdivision, and projections are unaltered. + +```ruby +args.outputs.sprites << { + x: 100, + y: 100, + w: 100, + h: 100, + path: "sprites/player.png", + angle: 0, + angle_anchor_x: 0.5, + angle_anchor_y: 1.0 +} +``` + +## Hash + +Here are all of the properites that are available on a sprite Hash. +Any parameters that are not specified will be given a default value. The keys of the hash can +be provided in any order. + +```ruby +args.outputs.sprites << { + x: 100, + y: 100, + w: 100, + h: 100, + path: "sprites/player.png", + angle: 0, + a, 255, + r: 255, + g: 255, + b: 255, + source_x: 0, + source_y: 0, + source_w: -1, + source_h: -1, + flip_vertically: false, + flip_horizontally: false, + angle_anchor_x: 0.5, + angle_anchor_y: 1.0 +} +``` + +## Duck Typing (Advanced) + +You can also create a class with sprite properties and render it as a primitive. +ALL properties must on the class. ADDITIONALLY, a method called `primitive_marker` +must be defined on the class. + +Here is an example: + +```ruby +# Create type with ALL sprite properties AND primitive_marker +class Sprite + attr_accessor :x, :y, :w, :h, :path, :angle, :a, :r, :g, :b, :source_x, + :source_y, :source_w, :source_h, :flip_horizontally, + :flip_vertically, :angle_anchor_x, :angle_anchor_y + + def primitive_marker + :sprite + end +end + +# Inherit from type +class PlayerSprite < Sprite + + # constructor + def initialize x, y, w, h + self.x = x + self.y = y + self.w = w + self.h = h + self.path = 'sprites/player.png' + end +end + +#render player sprite + +args.outputs.sprites << PlayerSprite.new(10, 10, 32, 64) +``` diff --git a/docs/todo/06-keyboard.md b/docs/todo/06-keyboard.md new file mode 100644 index 0000000..6fbe6d2 --- /dev/null +++ b/docs/todo/06-keyboard.md @@ -0,0 +1,150 @@ +# Keyboard + +Determining if `a` key is in the down state (pressed). This happens once each time the key is pressed: + +``` +if args.inputs.keyboard.key_down.a + puts 'The key is pressed' +end +``` + +Determining if a key is being held. This happens every tick while the key is held down: + +``` +if args.inputs.keyboard.key_held.a + puts 'The key is being held' +end +``` + +Determining if a key is in the down state or is being held: + +``` +if args.inputs.keyboard.a + puts 'The key is pressed or being held' +end +``` + +Determining if a key is in the up state (released). This happens once each time the key is released: + +``` +if args.inputs.keyboard.key_up.a + puts 'The key is released' +end +``` + +# Truthy Keys + +You can access all triggered keys through `truthy_keys` on `keyboard`, `controller_one`, and `controller_two`. + +This is how you would right all keys to a file. The game must be in the foreground and have focus for this data +to be recorded. + +``` +def tick args + [ + [args.inputs.keyboard, :keyboard], + [args.inputs.controller_one, :controller_one], + [args.inputs.controller_two, :controller_two] + ].each do |input, name| + if input.key_down.truthy_keys.length > 0 + args.gtk.write_file("mygame/app/#{name}_key_down_#{args.state.tick_count}", input.key_down.truthy_keys.to_s) + end + end +end +``` + +# List of keys: + +These are the character and associated properities that will +be set to true. + +For example `A => :a, :shift` means that `args.inputs.keyboard.a` +would be true and so would `args.inputs.keyboard.shift` +(if both keys were being held or in the down state). + +``` +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 +! => :exclamation_point +0 => :zero +1 => :one +2 => :two +3 => :three +4 => :four +5 => :five +6 => :six +7 => :seven +8 => :eight +9 => :nine +\b => :backspace +\e => :escape +\r => :enter +\t => :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 +# => :hash ++ => :plus +@ => :at +/ => :forward_slash +\ => :back_slash +* => :asterisk +< => :less_than +> => :greater_than +^ => :greater_than +& => :ampersand +² => :superscript_two +§ => :section_sign +? => :question_mark +% => :percent_sign +º => :ordinal_indicator +right arrow => :right +left arrow => :left +down arrow => :down +up arrow => :up +delete key => :delete +control key => :control +windows key/command key => :meta +alt key => :alt +``` diff --git a/docs/todo/07-mouse.md b/docs/todo/07-mouse.md new file mode 100644 index 0000000..2af8854 --- /dev/null +++ b/docs/todo/07-mouse.md @@ -0,0 +1,48 @@ +# Mouse + +Determining current position of mouse: + +``` +args.inputs.mouse.x +args.inputs.mouse.y +``` + +Determining if the mouse has been clicked, and it's position. Note: +`click` and `down` are aliases for each other. + +``` +if args.inputs.mouse.click + puts "click: #{args.inputs.mouse.click}" + puts "x: #{args.inputs.mouse.click.point.x}" + puts "y: #{args.inputs.mouse.click.point.y}" +end +``` + +Determining if the mouse button has been released: + +``` +if args.inputs.mouse.up + puts "up: #{args.inputs.mouse.up}" + puts "x: #{args.inputs.mouse.up.point.x}" + puts "y: #{args.inputs.mouse.up.point.y}" +end +``` + +Determine which mouse button(s) have been clicked (also works for up): +``` +if args.inputs.mouse.click + puts "left: #{args.inputs.mouse.button_left}" + puts "middle: #{args.inputs.mouse.button_middle}" + puts "right: #{args.inputs.mouse.button_right}" + puts "x1: #{args.inputs.mouse.button_x1}" + puts "x2: #{args.inputs.mouse.button_x2}" +end +``` + +Determine if the mouse wheel is being used and its values for this tick: +``` +if args.inputs.mouse.wheel + puts "The wheel moved #{args.inputs.mouse.wheel.x} left/right" + puts "The wheel moved #{args.inputs.mouse.wheel.y} up/down" +end +``` diff --git a/docs/todo/08-controllers.md b/docs/todo/08-controllers.md new file mode 100644 index 0000000..68bd9c2 --- /dev/null +++ b/docs/todo/08-controllers.md @@ -0,0 +1,86 @@ +# Controllers + +There are two controllers you have access to: + +``` +args.inputs.controller_one +args.inputs.controller_two +``` + +Determining if a key was down: + +``` +if args.inputs.controller_one.key_down.a + puts 'The key was in the down state' +end +``` + +Determining if a key is being held: + +``` +if args.inputs.controller_one.key_held.a + puts 'The key is being held' +end +``` + +Determining if a key is released: + +``` +if args.inputs.controller_one.key_up.a + puts 'The key is being held' +end +``` + +# Truthy Keys + +You can access all triggered keys through `thruthy_keys` on `keyboard`, `controller_one`, and `controller_two`. + +This is how you would write all keys to a file. The game must be in the foreground and have focus for this data +to be recorded. + +``` +def tick args + [ + [args.inputs.keyboard, :keyboard], + [args.inputs.controller_one, :controller_one], + [args.inputs.controller_two, :controller_two] + ].each do |input, name| + if input.key_down.truthy_keys.length > 0 + args.gtk.write_file("mygame/app/#{name}_key_down_#{args.state.tick_count}", input.key_down.truthy_keys.to_s) + end + end +end +``` + +# List of keys: + +``` +args.inputs.controller_one.key_held.up +args.inputs.controller_one.key_held.down +args.inputs.controller_one.key_held.left +args.inputs.controller_one.key_held.right +args.inputs.controller_one.key_held.a +args.inputs.controller_one.key_held.b +args.inputs.controller_one.x +args.inputs.controller_one.y +args.inputs.controller_one.key_held.l1 +args.inputs.controller_one.key_held.r1 +args.inputs.controller_one.key_held.l2 +args.inputs.controller_one.key_held.r2 +args.inputs.controller_one.key_held.l3 +args.inputs.controller_one.key_held.r3 +args.inputs.controller_one.key_held.start +args.inputs.controller_one.key_held.select +args.inputs.controller_one.key_held.directional_up +args.inputs.controller_one.key_held.directional_down +args.inputs.controller_one.key_held.directional_left +args.inputs.controller_one.key_held.directional_right +args.inputs.controller_one.left_analog_x_raw, +args.inputs.controller_one.left_analog_y_raw, +args.inputs.controller_one.left_analog_x_perc, +args.inputs.controller_one.left_analog_y_perc, +args.inputs.controller_one.right_analog_x_raw, +args.inputs.controller_one.right_analog_y_raw, +args.inputs.controller_one.right_analog_x_perc, +args.inputs.controller_one.right_analog_y_perc +``` diff --git a/docs/todo/09-scaling.md b/docs/todo/09-scaling.md new file mode 100644 index 0000000..9f63748 --- /dev/null +++ b/docs/todo/09-scaling.md @@ -0,0 +1,87 @@ +# Scaling + +The general idea is (for example): You'll have `sprite.png` + +- If you are missing `@1080p`, `sprite.png` will be scaled 1.5. +- If you're missing `@1440p`, `sprite.png`. + +And so on. In code, always use `sprite.png` paths withouth the @, and GTK will figure out the right png to use. + +``` ++------------+-------+------+------+------+------+------+------+------+------+ +| Resolution | @Name | Unit | 720 | 1080 | 1440 | 4K | 5K | 6K | 8K | ++------------+-------+-----:+-----:+-----:+-----:+-----:+-----:+-----:+-----:+ +| 1280x720 | 720p | 2px | 1x | - | - | - | - | - | - | +| 1920x1080 | 1080p | 3px | 1.5x | 1x | - | - | - | - | - | +| 2560x1440 | 1440p | 4px | 2x | - | 1x | - | - | - | - | +| 3840x2160 | 4K | 6px | 3x | 2x | - | 1x | - | - | - | +| 5120x2880 | 5K | 8px | 4x | - | 2x | - | 1x | - | - | +| 5760x3240 | 6K | 9px | 4.5x | 3x | - | - | - | 1x | - | +| 7680x4320 | 8K | 12px | 6x | 4x | 3x | 2x | - | - | 1x | ++------------+-------+------+------+------+------+------+------+------+------+ +| 640x360 | 360p | 2px | 0.5x | - | - | - | - | - | - | ++------------+-------+------+------+------+------+------+------+------+------+ +``` + +# Layout Theory (work in progress) + +Where it gets tricky is mobile. The algorithm there would be to find +the nearest pixel perfect resolution and then allow for rendering +outside of the logical canvas, which will be centered in the +screen. `grid.left` in these cases will be a negative number and will +exclude "unsafe" areas (which are only applicable to phones with edge +to edge screens... god help us all if I have to introduce a +`grid.(left|right|top|bottom)_unsafe`). + +## Variables that need to be considered. + +- logical pixel of device +- logical pixels of canvas (720p) +- physical pixel of device + +## Well known aspect ratios + + - 720p + - 1080p + - 1440p + - 4k + - 5k + - 6k + - 8k + +## Laws that support Layout Theory + + - Logical pixels is 720p for a game. + - The logical pixels for the game is centered in the device. + - The logical pixesl is the only safe area for the game. + +## Math + + 1. Take the logical widht and height of the iphone, assume the thinner part is the "9" of the "16:9" aspect ratio. Example: 414 / 896 = 720 / x ... x = 1558 + 2. Determine the scale down from the 720 to the target "9". Example: 720 * x = 414 ... x = .575 + 3. Determine the "other side" of the 16?? : 9 aspect ratio for the target device (which might not be 16). Example: 1280 / 1558 = x / 896 ... x = 736 + 4. And then scale that down. Example: 1558.3 * .575 ... x = 896 + 5. Determine the 16:9 scaled. Example 414 x 736 + 6. Determine the unsafe area. Example: (896 - 736) / 2 = 65 + 7. Verify the math and make sure the aspect ratio makes sense. Example: 1558 / (720 / 9) = 19.5 + 8. Verify result. Example: 9 : 19.5 with 1.75 unsafe on either side = 140 logical pixels on + either side To support iPhone 11 Pro, you must render a game where you render -140 to 1420. 720 x 1280 logical. + +## Scale Table + +The Physical pixels for the iPhone 11 is 1242 X 2688. This is used to determine which texture will be used from the texture atlas. + +``` ++------------+-------+------+------+------+------+------+------+------+------+ +| Resolution | @Name | Unit | 720 | 1080 | 1440 | 4K | 5K | 6K | 8K | ++------------+-------+-----:+-----:+-----:+-----:+-----:+-----:+-----:+-----:+ +| 1280x720 | - | 2px | 1x | - | - | - | - | - | - | +| 1920x1080 | 1080p | 3px | 1.5x | 1x | - | - | - | - | - | +| 2560x1440 | 1440p | 4px | 2x | - | 1x | - | - | - | - | +| 3840x2160 | 4K | 6px | 3x | 2x | - | 1x | - | - | - | +| 5120x2880 | 5K | 8px | 4x | - | 2x | - | 1x | - | - | +| 5760x3240 | 6K | 9px | 4.5x | 3x | - | - | - | 1x | - | +| 7680x4320 | 8K | 12px | 6x | 4x | 3x | 2x | - | - | 1x | ++------------+-------+------+------+------+------+------+------+------+------+ +``` diff --git a/docs/todo/99-todo.md b/docs/todo/99-todo.md new file mode 100644 index 0000000..39c542a --- /dev/null +++ b/docs/todo/99-todo.md @@ -0,0 +1,89 @@ +# Documentation That Needs to be Organized + +## Class macro gtk_args + +Here's how you can use the `gtk_args` class method: + +```ruby +class Game + gtk_args + attr_accessor :current_scene, :other_custom_attrs + + def tick + end +end + +$game = Game.new + +def tick args + $game.args = args + $game.tick +end +``` + +The code above is the similar to: + +```ruby +class Game + attr_accessor :args, :grid, :state, :inputs, :outputs, :gtk, :passes, + :current_scene, :other_custom_attrs + + def tick + end +end + +$game = Game.new + +def tick args + $game.args = args + $game.grid = args.grid + $game.state = args.state + $game.outputs = args.outputs + $game.gtk = args.gtk + $game.passes = args.passes + $game.tick +end +``` + +## Monkey patching the runtime + +You're on your own if you do this :grimacing: + +```ruby +module GTK + class Runtime + alias_method :__original_tick_core__, :tick_core unless Runtime.instance_methods.include?(:__original_tick_core__) + + def tick_core + __original_tick_core__ + $top_level.oh @args + $top_level.god @args + $top_level.why @args + end + end +end + +def tick args +end + +def oh args +end + +def god args +end + +def why args +end +``` + +## MP3's to Wav converstion script: + +```ruby +`ls .`.each_line.to_a.map do |l| + l = l.strip + if l.end_with? "mp3" + `ffmpeg -i #{l} -acodec pcm_s16le -ar 44100 prep-#{l.split(".")[0]}.wav` + `ffmpeg -y -i prep-#{l.split(".")[0]}.wav -f wav -bitexact -acodec pcm_s16le -ar 44100 -ac 1 #{l.split(".")[0]}.wav` + end +end +``` |
