diff options
| author | realtradam <[email protected]> | 2022-01-03 07:34:38 -0500 |
|---|---|---|
| committer | realtradam <[email protected]> | 2022-01-03 07:34:38 -0500 |
| commit | 55f1db30e7a609cebd2fab27c55ece1da45be232 (patch) | |
| tree | 286045c958877ea872c69990d289dbf4c44c3c32 /docs/file.README.html | |
| parent | 809028c3d89993b2bb0651076ba723c11734cf3c (diff) | |
| download | FelECS-55f1db30e7a609cebd2fab27c55ece1da45be232.tar.gz FelECS-55f1db30e7a609cebd2fab27c55ece1da45be232.zip | |
.
Diffstat (limited to 'docs/file.README.html')
| -rw-r--r-- | docs/file.README.html | 106 |
1 files changed, 55 insertions, 51 deletions
diff --git a/docs/file.README.html b/docs/file.README.html index 11b0848..8565de7 100644 --- a/docs/file.README.html +++ b/docs/file.README.html @@ -76,11 +76,11 @@ <ul> <li><a href="#what-is-felflame">What is FelFlame?</a></li> <li><a href="#what-is-ecs">What is ECS?</a> - - <a href="#components">Components</a> - - <a href="#entities">Entities</a> - - <a href="#systems">Systems</a> - - <a href="#scenes">Scenes</a> - - <a href="#stage">Stage</a></li> + * <a href="#components">Components</a> + * <a href="#entities">Entities</a> + * <a href="#systems">Systems</a> + * <a href="#scenes">Scenes</a> + * <a href="#stage">Stage</a></li> <li><a href="#usage">Usage</a> <ul> @@ -89,7 +89,6 @@ <ul> <li><a href="#creation">Creation</a></li> <li><a href="#accessing">Accessing</a></li> -<li><a href="#get-id">Get ID</a></li> <li><a href="#adding-and-removing-components">Adding and Removing Components</a></li> <li><a href="#accessing-entities-attached-components">Accessing Entities' Attached Components</a></li> <li><a href="#deletion">Deletion</a></li> @@ -99,10 +98,9 @@ <ul> <li><a href="#creating-a-component-manager">Creating a Component Manager</a></li> <li><a href="#creating-a-component-from-a-component-manager">Creating a Component from a Component Manager</a></li> -<li><a href="#accessing-and-getting-id">Accessing and Getting ID</a></li> +<li><a href="#accessing-1">Accessing</a></li> <li><a href="#accessing-attributes-and-changing-them">Accessing Attributes and Changing Them</a></li> <li><a href="#deleting-components">Deleting Components</a></li> -<li><a href="#iterating-over-components">Iterating over Components</a></li> <li><a href="#accessing-components-attached-entities">Accessing Components' attached Entities</a></li> </ul></li> <li><a href="#systems-1">Systems</a> @@ -118,7 +116,7 @@ <ul> <li><a href="#creation-2">Creation</a></li> -<li><a href="#accessing-1">Accessing</a></li> +<li><a href="#accessing-2">Accessing</a></li> <li><a href="#adding-systems">Adding Systems</a></li> <li><a href="#removing-systems">Removing Systems</a></li> <li><a href="#clearing">Clearing</a></li> @@ -185,11 +183,13 @@ ECS stands for Entity, Component, and System.</p> <hr> -<p>If all of this sounds very confusing, don't worry. A video tutorial series is in the works where I will build a game using this framework and explain every step of the way. You can also read some examples and explanations below.</p> - <h1 id="usage">Usage</h1> -<p>To use FelFlame simply install the gem using <code>gem install felflame</code> or using bundler <code>bundle add felflame</code> and then require it in your project like so: <code>require 'felflame'</code>. Working outside of the gem for rendering engines that do not support the usage of gems is a planned feature in the works.</p> +<p>There are 2 ways of using FelFlame. You can either <code>include</code> it as a gem in your project if your game engine supports this. The other option is to download the single file export of FelFlame and then <code>require_relative</code> this file in your project. The single file export takes all the ruby code in the various files and concatenates them into a single file so it is more portable and easy to add.</p> + +<p>To use the gem method you can do the following: install the gem using <code>gem install felflame</code> or using bundler <code>bundle add felflame</code> and then require it in your project like so: <code>require 'felflame'</code>.</p> + +<p>To use the single file export method you simply download the felflame.rb file from the <a href="https://github.com/realtradam/FelFlame/releases">releases page on Github</a> and add it to your source folder and add a <code>require relative 'felflame.rb'</code> line or wherever you have placed the file to use it.</p> <h2 id="entities">Entities</h2> @@ -200,29 +200,24 @@ ECS stands for Entity, Component, and System.</p> <pre class="code ruby"><code class="ruby"><span class='ivar'>@entity</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Entities.html" title="FelFlame::Entities (class)">Entities</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FelFlame/Entities.html#initialize-instance_method" title="FelFlame::Entities#initialize (method)">new</a></span></span> </code></pre> -<p>or if we want to add (any number of)components to it:</p> +<p>or if we want to add (any number of)components to it when creating it:</p> <pre class="code ruby"><code class="ruby"><span class='ivar'>@entity</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span><span class='op'>::</span><span class='const'>Entites</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (module)">Components</a></span></span><span class='op'>::</span><span class='const'>Health</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='comma'>,</span> <span class='ivar'>@component</span><span class='comma'>,</span> - <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (module)">Components</a></span></span><span class='op'>::</span><span class='const'>Armour</span><span class='lbracket'>[</span><span class='int'>7</span><span class='rbracket'>]</span> + <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (module)">Components</a></span></span><span class='op'>::</span><span class='const'>EnemyTeam</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span> <span class='rparen'>)</span> </code></pre> <h3 id="accessing">Accessing</h3> -<p>Once components are created we can access them using their ID like so:</p> +<p>Oftentimes you will not be accessing an Entity this way. Later we will shows you a more common way of accessing entities. +If you need to you can access Entities using the <code>Entities</code> module:</p> <pre class="code ruby"><code class="ruby"><span class='ivar'>@entity</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Entities.html" title="FelFlame::Entities (class)">Entities</a></span></span><span class='lbracket'>[</span><span class='int'>2</span><span class='rbracket'>]</span> -</code></pre> - -<h3 id="get-id">Get ID</h3> - -<p>Entity ID's are generated starting from 0 and ascending, unless if there is a missing ID because of a deleted -entity where a new entity will claim that ID. To get the ID of an Entity:</p> - -<pre class="code ruby"><code class="ruby"><span class='ivar'>@entity</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> -</code></pre> +<span class='ivar'>@entity</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Entities.html" title="FelFlame::Entities (class)">Entities</a></span></span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span> +<span class='ivar'>@entity</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Entities.html" title="FelFlame::Entities (class)">Entities</a></span></span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='comment'># you can iterate over all entities this way. Any valid array method can be used +</span></code></pre> <h3 id="adding-and-removing-components">Adding and Removing Components</h3> @@ -234,14 +229,18 @@ entity where a new entity will claim that ID. To get the ID of an Entity:</p> <h3 id="accessing-entities-attached-components">Accessing Entities' Attached Components</h3> +<p>This is the most common way of accessing an Entity</p> + <p>When Components are added to Entities, they can be accessed from the Entity. By using a Component Manager as a key we can access an array of all components created from that Component Manager that are attached to an entity:</p> -<pre class="code ruby"><code class="ruby"><span class='ivar'>@entity</span><span class='period'>.</span><span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='ivar'>@component_manager</span><span class='rbracket'>]</span> <span class='comment'># => [@component1, @component2, component3] +<pre class="code ruby"><code class="ruby"><span class='ivar'>@entity</span><span class='period'>.</span><span class='id identifier rubyid_components'>components</span><span class='lbracket'>[</span><span class='ivar'>@component_manager</span><span class='rbracket'>]</span> <span class='comment'># => [@component1, @component2, @component3] </span></code></pre> <h3 id="deletion">Deletion</h3> -<p>To have all Components from an Entity removed and the Entity deleted we do the following:</p> +<p>To have all Components from an Entity <strong>removed</strong> and the Entity deleted we do the following:</p> + +<p>NOTE: The components will <strong>not be deleted</strong>. They are simply <strong>removed</strong> from the entity and then the entity is destroyed. You must handle component deletion yourself as for example singleton components need to removed instead of deleted.</p> <pre class="code ruby"><code class="ruby"><span class='ivar'>@entity</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> </code></pre> @@ -270,19 +269,18 @@ When defining attributes symbols should be used.</p> <pre class="code ruby"><code class="ruby"><span class='ivar'>@component</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (module)">Components</a></span></span><span class='op'>::</span><span class='const'>Stats</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> </code></pre> -<p>Or we can even change the defaults:</p> +<p>Or we can even override the defaults when creating the component:</p> <pre class="code ruby"><code class="ruby"><span class='ivar'>@component</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (module)">Components</a></span></span><span class='op'>::</span><span class='const'>Stats</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>armour:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>steel</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> </code></pre> -<h3 id="accessing-and-getting-id">Accessing and Getting ID</h3> +<h3 id="accessing">Accessing</h3> -<p>Just like Entities, Components have IDs. -These IDs are only unique within the scope of their respective Component Managers. -Here is how we can get the ID, as well as how to access a Component from its Component Manager.</p> +<p>You can access components using any array method.</p> <pre class="code ruby"><code class="ruby"><span class='ivar'>@component</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (module)">Components</a></span></span><span class='op'>::</span><span class='const'>Stats</span><span class='lbracket'>[</span><span class='int'>2</span><span class='rbracket'>]</span> -<span class='ivar'>@component</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='comment'># => 2 +<span class='ivar'>@component</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (module)">Components</a></span></span><span class='op'>::</span><span class='const'>Stats</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span> +<span class='ivar'>@component</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (module)">Components</a></span></span><span class='op'>::</span><span class='const'>Stats</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='comment'># you can use iterators this way </span></code></pre> <h3 id="accessing-attributes-and-changing-them">Accessing Attributes and Changing Them</h3> @@ -295,30 +293,26 @@ Here are the ways to edit attrubutes, followed by the ways to read them.</p> </code></pre> <pre class="code ruby"><code class="ruby"><span class='ivar'>@component</span><span class='period'>.</span><span class='id identifier rubyid_hp'>hp</span> <span class='comment'># => 95 -</span><span class='ivar'>@component</span><span class='period'>.</span><span class='id identifier rubyid_attrs'>attrs</span> <span class='comment'># => {armour: 'Leather', hp: 95} +</span><span class='ivar'>@component</span><span class='period'>.</span><span class='id identifier rubyid_to_h'>to_h</span> <span class='comment'># => {armour: 'Leather', hp: 95} </span></code></pre> <h3 id="deleting-components">Deleting Components</h3> -<p>Deleting a Component is the same format as deleting an Entity. When a Component is deleted referenced to it such as to entities are automatically cleared.</p> +<p>Deleting a Component is the same convention as deleting an Entity. When a Component is deleted referenced to it such as to entities are automatically cleared.</p> <pre class="code ruby"><code class="ruby"><span class='ivar'>@component</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> </code></pre> -<h3 id="iterating-over-components">Iterating over Components</h3> - -<p>When you make Systems you will want to be able to iterate over all Components of the same Component Manager(for example iterating over all sprites to render them). Here is how we do that:</p> - -<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (module)">Components</a></span></span><span class='op'>::</span><span class='const'>Sprites</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_component'>component</span><span class='op'>|</span> - <span class='comment'>#do something with components -</span><span class='kw'>end</span> -</code></pre> - <h3 id="accessing-components-attached-entities">Accessing Components' attached Entities</h3> <p>Components also keep track of what Entities are using it. To access this list we do the following:</p> <pre class="code ruby"><code class="ruby"><span class='ivar'>@component</span><span class='period'>.</span><span class='id identifier rubyid_entities'>entities</span> <span class='comment'># => [@entity1, @entity2, @entity3] +</span> +<span class='comment'># get the first entity attached. +</span><span class='comment'># this will throw a warning if there is more or less then +</span><span class='comment'># exactly one entity +</span><span class='ivar'>@component</span><span class='period'>.</span><span class='id identifier rubyid_entity'>entity</span> <span class='comment'># => @entity </span></code></pre> <h2 id="systems">Systems</h2> @@ -339,7 +333,9 @@ Here are the ways to edit attrubutes, followed by the ways to read them.</p> <p>Priority determines the order Systems should be executed, this is used for <code>Scenes</code> and the <code>Stage</code>. The lower the number, the earlier a given System will be executed. -E.g priority 1 will go first, priority 2 will go second, etcetera. </p> +E.g priority 1 will go first, priority 2 will go second, etcetera. </p> + +<p>Both Scenes and Systems have a priority. System priority will decide the order it will be called inside of a Scene, which the Scene priority will decide the order it will be called inside of the Stage.</p> <p>Often we will want to execute some logic on each Component in a given Component Manager so our code might look like this:</p> @@ -437,7 +433,7 @@ E.g priority 1 will go first, priority 2 will go second, etcetera. </p> <p>Once we have all the core parts of ECS, we will want to organize our Systems. To do this we will use Scenes to group up Systems so they can quickly be enabled or disabled. Note that <a href="#alternative-execution">Alternative Executions</a> will occur even if they are not part of a Scene. Here is how we make a new Scene:</p> -<pre class="code ruby"><code class="ruby"><span class='ivar'>@scene</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Scenes.html" title="FelFlame::Scenes (class)">Scenes</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FelFlame/Scenes.html#initialize-instance_method" title="FelFlame::Scenes#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>ExampleScene</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> +<pre class="code ruby"><code class="ruby"><span class='ivar'>@scene</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Scenes.html" title="FelFlame::Scenes (class)">Scenes</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FelFlame/Scenes.html#initialize-instance_method" title="FelFlame::Scenes#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>ExampleScene</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>priority:</span> <span class='int'>5</span><span class='rparen'>)</span> </code></pre> <h3 id="accessing">Accessing</h3> @@ -451,14 +447,22 @@ E.g priority 1 will go first, priority 2 will go second, etcetera. </p> <p>Adding Systems is simple. We can add as many as we want. In this example we add 3 different systems:</p> -<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Scenes.html" title="FelFlame::Scenes (class)">Scenes</a></span></span><span class='op'>::</span><span class='const'>ExampleScene</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>Render</span><span class='comma'>,</span> <span class='ivar'>@system2</span><span class='comma'>,</span> <span class='ivar'>@system3</span><span class='rparen'>)</span> +<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Scenes.html" title="FelFlame::Scenes (class)">Scenes</a></span></span><span class='op'>::</span><span class='const'>ExampleScene</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span> + <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>Render</span><span class='comma'>,</span> + <span class='ivar'>@system2</span><span class='comma'>,</span> + <span class='ivar'>@system3</span> +<span class='rparen'>)</span> </code></pre> <h3 id="removing-systems">Removing Systems</h3> -<p>Removing Systems works simularly:</p> +<p>Removing Systems works similarly:</p> -<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Scenes.html" title="FelFlame::Scenes (class)">Scenes</a></span></span><span class='op'>::</span><span class='const'>ExampleScene</span><span class='period'>.</span><span class='id identifier rubyid_remove'>remove</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>Render</span><span class='comma'>,</span> <span class='ivar'>@system2</span><span class='comma'>,</span> <span class='ivar'>@system3</span><span class='rparen'>)</span> +<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Scenes.html" title="FelFlame::Scenes (class)">Scenes</a></span></span><span class='op'>::</span><span class='const'>ExampleScene</span><span class='period'>.</span><span class='id identifier rubyid_remove'>remove</span><span class='lparen'>(</span> + <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>Render</span><span class='comma'>,</span> + <span class='ivar'>@system2</span><span class='comma'>,</span> + <span class='ivar'>@system3</span> +<span class='rparen'>)</span> </code></pre> <h3 id="clearing">Clearing</h3> @@ -481,7 +485,7 @@ E.g priority 1 will go first, priority 2 will go second, etcetera. </p> <h3 id="adding-scenes">Adding Scenes</h3> -<p>Finally we have the Stage. There is only a single Stage and we do not have to create it as it exists by default. By adding a Scene to the Stage we are saying that the Scene is active. To add a Scene we do the following:</p> +<p>Finally we have the Stage. There is only a single Stage and we do not have to create it as it exists by default. By adding a Scene to the Stage we are saying that the Scene is 'active'. To add a Scene we do the following:</p> <pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Stage.html" title="FelFlame::Stage (module)">Stage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_add'><span class='object_link'><a href="FelFlame/Stage.html#add-class_method" title="FelFlame::Stage.add (method)">add</a></span></span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span><span class='op'>::</span><span class='const'>Scene</span><span class='op'>::</span><span class='const'>ExampleScene</span> </code></pre> @@ -495,7 +499,7 @@ E.g priority 1 will go first, priority 2 will go second, etcetera. </p> <h3 id="executing">Executing</h3> -<p>On each frame of the game we want to execute the Stage once. When the Stage is executed it is progressing your game 1 frame forward. The Stage will make sure for you that all the Systems from all Scenes added will be executed in the correct order according to their priority. Here is how we do it:</p> +<p>On each frame of the game generally we will want to execute the Stage once. When the Stage is executed it is progressing your game 1 frame forward. The Stage will call all Scenes you added to it in the order of their priority. Here is how we do it:</p> <pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (module)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Stage.html" title="FelFlame::Stage (module)">Stage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_call'><span class='object_link'><a href="FelFlame/Stage.html#call-class_method" title="FelFlame::Stage.call (method)">call</a></span></span> </code></pre> @@ -514,7 +518,7 @@ E.g priority 1 will go first, priority 2 will go second, etcetera. </p> </div></div> <div id="footer"> - Generated on Mon Jan 3 06:20:46 2022 by + Generated on Mon Jan 3 07:34:30 2022 by <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> 0.9.26 (ruby-2.7.3). </div> |
