Permalink
Browse files

typos

  • Loading branch information...
ondras committed Apr 4, 2013
1 parent 7065cde commit d4ea2abb55432929aee1ed81cac10cebdda5aebb
View
@@ -1,6 +1,6 @@
<h2>Timing &amp; scheduling</h2>
<p>Both realtime and turn-based games need to maintain the notion of a time: to manage events, schedule turns, perform correct timing and related measurements. <strong>rot.js</strong> offsers several helper tools at varying levels of abstraction to help with these tasks. Click on individual sub-chapters to read more detailed information.</p>
<p>Both realtime and turn-based games need to maintain the notion of a time: to manage events, schedule turns, perform correct timing and related measurements. <strong>rot.js</strong> offers several helper tools at varying levels of abstraction to help with these tasks. Click on individual sub-chapters to read more detailed information.</p>
<ol>
<li><a href="#timing/eventqueue">Event queue</a> is the most low-level approach: a simple priority queue that maintains a correct order of time-based data.</li>
@@ -1,6 +1,6 @@
<h2>Asynchronous game engine</h2>
<p>Client-side JavaScript is non-blocking: all long-running operations are asynchronous. The <code>ROT.Engine</code> loop is well suited for orchestrating the possibly-async coordination of various game actors.</p>
<p>Client-side JavaScript is non-blocking: all long-running operations are asynchronous. The <code>ROT.Engine</code> loop is well suited to orchestrating the possibly-async coordination of various game actors.</p>
<p>To use the engine, you first need a <a href="#timing/scheduler">scheduler</a> that stores your actors and manages their priority. This scheduler is passed to <code>ROT.Engine</code>'s constructor. Once the engine is started, it correctly calls the <code>act()</code> method on proper actors (picked by the scheduler). It is possible to recursively stop (lock) the engine, should some operation (such as displaying a dialog or waiting for user input) block the execution. Once all lock levels are unlocked, the engine continues its execution.</p>
@@ -1,6 +1,6 @@
<h2>Event queue</h2>
<p><code>ROT.EventQueue</code> is a very simple tool to maintain a sorted priority list. It offers basic API for adding, removing and retrieving stuff. For most scenarios, the Event queue is too low-level and you might be wanting to use a specific <a href="#timing/scheduler">scheduler</a> instead.</p>
<p><code>ROT.EventQueue</code> is a very simple tool to maintain a sorted priority list. It offers basic API for adding, removing and retrieving stuff. For most scenarios, the Event queue is too low-level and you might want to use a specific <a href="#timing/scheduler">scheduler</a> instead.</p>
<p>Time units in Event queue are abstract and do not need to be integers. The <code>getTime()</code> method can be used to retrieve the amount of already elapsed time units.</p>
@@ -1,11 +1,11 @@
<h2>Scheduler</h2>
<p>There are many ways and strategies of scheduling game turns and/or actors. The <code>ROT.Scheduler</code> API is meant as a general scheduling abstraction; there are also three distinct implementation for commonly used scheduling approaches.</p>
<p>There are many ways and strategies of scheduling game turns and/or actors. The <code>ROT.Scheduler</code> API is meant as a general scheduling abstraction; there are also three distinct implementations for commonly used scheduling approaches.</p>
<p>All available schedulers share these common methods:</p>
<ul>
<li><code>add(item, repeat)</code> to add a new schedulable item. There are no specific requirements for the <code>item</code> argument. Second argument specifies whether the scheduler shall treat the item as a repeated actor (such as a being or player), or a one-time event (such as an earthquake or a messenger appearing from nowhere).</li>
<li><code>add(item, repeat)</code> to add a new schedulable item. There are no specific requirements for the <code>item</code> argument. The second argument specifies whether the scheduler shall treat the item as a repeated actor (such as a being or player), or a one-time event (such as an earthquake or a messenger appearing from nowhere).</li>
<li><code>remove(item)</code> to remove a previously added item</li>
<li><code>clear()</code> to remove all items</li>
<li><code>getTime()</code> to retrieve the elapsed time from the (internally) used <a href="#timing/eventqueue">Event queue</a></li>

0 comments on commit d4ea2ab

Please sign in to comment.