f3fc28996523

beast: Update site.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Fri, 23 Dec 2016 10:50:32 -0500
parents 00c5f966ddac
children 9133e251a03d
branches/tags (none)
files beast/index.html beast/overview/index.html beast/reference/index.html beast/usage/index.html

Changes

--- a/beast/index.html	Fri Dec 16 13:20:20 2016 -0500
+++ b/beast/index.html	Fri Dec 23 10:50:32 2016 -0500
@@ -16,7 +16,7 @@
 Lisp.  It's a thin layer of sugar over CLOS that makes it easy to write flexible
 objects for video games.</p>
 <p>Beast can be installed with <a href="https://quicklisp.org/">Quicklisp</a>:</p>
-<div class="codehilite"><pre>(ql:quickload :beast)
+<div class="codehilite"><pre><span></span>(ql:quickload :beast)
 </pre></div>
 
 
--- a/beast/overview/index.html	Fri Dec 16 13:20:20 2016 -0500
+++ b/beast/overview/index.html	Fri Dec 23 10:50:32 2016 -0500
@@ -20,12 +20,13 @@
 <li><a href="http://en.wikipedia.org/wiki/Entity_component_system">http://en.wikipedia.org/wiki/Entity_component_system</a></li>
 <li><a href="http://www.gamedev.net/page/resources/_/technical/game-programming/understanding-component-entity-systems-r3013">http://www.gamedev.net/page/resources/_/technical/game-programming/understanding-component-entity-systems-r3013</a></li>
 </ul>
-<p>There are a couple of ECS libraries for Common Lisp already:</p>
+<p>There were a couple of ECS libraries for Common Lisp already:</p>
 <ul>
-<li><a href="https://github.com/lispgames/cl-ecs">cl-ecs</a></li>
-<li><a href="https://github.com/mfiano/ecstasy">ecstasy</a></li>
+<li>cl-ecs</li>
+<li>ecstasy</li>
 </ul>
-<p>Both of these favor composition over inheritance -- game objects (entities)
+<p>Which were both superseded by <a href="https://github.com/mfiano/net.axity.common-lisp.gamedev/tree/master/ecs">net.axity.common-lisp.gamedev.ecs</a>.</p>
+<p>All of these favor composition over inheritance -- game objects (entities)
 <em>contain</em> various components, but they don't <em>inherit</em> from components.</p>
 <p>Beast takes the opposite approach, favoring (restricted) inheritance over
 composition.</p>
@@ -33,7 +34,7 @@
 a little bit less in this crazy world.  Aspects are essentially
 <a href="https://en.wikipedia.org/wiki/Mixin">mixins</a>, with some sugar for defining them
 and running systems over them:</p>
-<div class="codehilite"><pre><span class="p">(</span><span class="nv">define-aspect</span> <span class="nv">throwable</span> <span class="nv">accuracy</span> <span class="nv">damage</span><span class="p">)</span>
+<div class="codehilite"><pre><span/><span class="p">(</span><span class="nv">define-aspect</span> <span class="nv">throwable</span> <span class="nv">accuracy</span> <span class="nv">damage</span><span class="p">)</span>
 <span class="p">(</span><span class="nv">define-aspect</span> <span class="nv">edible</span> <span class="nv">nutrition-value</span><span class="p">)</span>
 
 <span class="p">(</span><span class="nv">define-entity</span> <span class="nv">dart</span> <span class="p">(</span><span class="nv">throwable</span><span class="p">))</span>
--- a/beast/reference/index.html	Fri Dec 16 13:20:20 2016 -0500
+++ b/beast/reference/index.html	Fri Dec 23 10:50:32 2016 -0500
@@ -35,7 +35,7 @@
 </ul></div>
 <h2 id="package-beast">Package <code>BEAST</code></h2>
 <h3 id="clear-entities-function"><code>CLEAR-ENTITIES</code> (function)</h3>
-<div class="codehilite"><pre>(CLEAR-ENTITIES)
+<div class="codehilite"><pre><span/>(CLEAR-ENTITIES)
 </pre></div>
 
 
@@ -43,7 +43,7 @@
 <p><code>destroy-entity</code> will be called for each entity.</p>
 <p>Returns a list of all the destroyed entites.</p>
 <h3 id="create-entity-function"><code>CREATE-ENTITY</code> (function)</h3>
-<div class="codehilite"><pre>(CREATE-ENTITY CLASS &amp;REST INITARGS)
+<div class="codehilite"><pre><span/>(CREATE-ENTITY CLASS &amp;REST INITARGS)
 </pre></div>
 
 
@@ -52,7 +52,7 @@
 <p>The <code>entity-created</code> generic function will be called just before returning the
   entity.</p>
 <h3 id="define-aspect-macro"><code>DEFINE-ASPECT</code> (macro)</h3>
-<div class="codehilite"><pre>(DEFINE-ASPECT NAME &amp;REST FIELDS)
+<div class="codehilite"><pre><span/>(DEFINE-ASPECT NAME &amp;REST FIELDS)
 </pre></div>
 
 
@@ -65,7 +65,7 @@
   the slot names.  <code>:initarg</code> and <code>:accessor</code> slot options will also be
   automatically generated.</p>
 <p>Example:</p>
-<div class="codehilite"><pre>(define-aspect edible
+<div class="codehilite"><pre><span/>(define-aspect edible
   energy
   (taste :initform nil))
 =&gt;
@@ -79,7 +79,7 @@
 
 
 <h3 id="define-entity-macro"><code>DEFINE-ENTITY</code> (macro)</h3>
-<div class="codehilite"><pre>(DEFINE-ENTITY NAME ASPECTS &amp;REST SLOTS)
+<div class="codehilite"><pre><span/>(DEFINE-ENTITY NAME ASPECTS &amp;REST SLOTS)
 </pre></div>
 
 
@@ -88,7 +88,7 @@
 <p><code>aspects</code> should be a list of the aspects this entity should inherit from.</p>
 <p><code>slots</code> can be zero or more extra CLOS slot definitions.</p>
 <p>Examples:</p>
-<div class="codehilite"><pre>(define-entity potion (drinkable))
+<div class="codehilite"><pre><span/>(define-entity potion (drinkable))
 
 (define-entity cheese (edible visible)
   (flavor :accessor cheese-flavor :initarg :flavor))
@@ -96,7 +96,7 @@
 
 
 <h3 id="define-system-macro"><code>DEFINE-SYSTEM</code> (macro)</h3>
-<div class="codehilite"><pre>(DEFINE-SYSTEM NAME-AND-OPTIONS
+<div class="codehilite"><pre><span/>(DEFINE-SYSTEM NAME-AND-OPTIONS
     ARGLIST
   &amp;BODY
   BODY)
@@ -121,7 +121,7 @@
     entity.  Defaults to <code>nil</code>.</li>
 </ul>
 <p>Examples:</p>
-<div class="codehilite"><pre>(define-system age ((entity lifetime))
+<div class="codehilite"><pre><span/>(define-system age ((entity lifetime))
   (when (&gt; (incf (lifetime/age entity))
            (lifetime/lifespan entity))
     (destroy-entity entity)))
@@ -129,7 +129,7 @@
 
 
 <h3 id="destroy-entity-function"><code>DESTROY-ENTITY</code> (function)</h3>
-<div class="codehilite"><pre>(DESTROY-ENTITY ENTITY)
+<div class="codehilite"><pre><span/>(DESTROY-ENTITY ENTITY)
 </pre></div>
 
 
@@ -139,7 +139,7 @@
 <h3 id="entity-class"><code>ENTITY</code> (class)</h3>
 <p>A single entity in the game world.</p>
 <h3 id="entity-created-generic-function"><code>ENTITY-CREATED</code> (generic function)</h3>
-<div class="codehilite"><pre>(ENTITY-CREATED ENTITY)
+<div class="codehilite"><pre><span/>(ENTITY-CREATED ENTITY)
 </pre></div>
 
 
@@ -147,7 +147,7 @@
 <p>The default method does nothing, but users can implement their own auxillary
   methods to run code when entities are created.</p>
 <h3 id="entity-destroyed-generic-function"><code>ENTITY-DESTROYED</code> (generic function)</h3>
-<div class="codehilite"><pre>(ENTITY-DESTROYED ENTITY)
+<div class="codehilite"><pre><span/>(ENTITY-DESTROYED ENTITY)
 </pre></div>
 
 
@@ -155,7 +155,7 @@
 <p>The default method does nothing, but users can implement their own auxillary
   methods to run code when entities are destroyed.</p>
 <h3 id="map-entities-function"><code>MAP-ENTITIES</code> (function)</h3>
-<div class="codehilite"><pre>(MAP-ENTITIES FUNCTION &amp;OPTIONAL (TYPE 'ENTITY))
+<div class="codehilite"><pre><span/>(MAP-ENTITIES FUNCTION &amp;OPTIONAL (TYPE 'ENTITY))
 </pre></div>
 
 
--- a/beast/usage/index.html	Fri Dec 16 13:20:20 2016 -0500
+++ b/beast/usage/index.html	Fri Dec 23 10:50:32 2016 -0500
@@ -37,7 +37,7 @@
 examples could be things like: location, moveable, visible, edible, sentient.</p>
 <h3 id="defining-aspects">Defining Aspects</h3>
 <p>To define an aspect you use <code>define-aspect</code>:</p>
-<div class="codehilite"><pre><span class="p">(</span><span class="nv">define-aspect</span> <span class="nv">location</span> <span class="nv">x</span> <span class="nv">y</span><span class="p">)</span>
+<div class="codehilite"><pre><span/><span class="p">(</span><span class="nv">define-aspect</span> <span class="nv">location</span> <span class="nv">x</span> <span class="nv">y</span><span class="p">)</span>
 <span class="p">(</span><span class="nv">define-aspect</span> <span class="nv">edible</span> <span class="nv">nutrition-value</span><span class="p">)</span>
 </pre></div>
 
@@ -46,13 +46,13 @@
 <p>The names of aspect slots will be have the aspect name prepended to them with
 a slash to avoid clashing between aspects, and the <code>initargs</code> and <code>accessors</code>
 will be added for you.  So for example, this:</p>
-<div class="codehilite"><pre><span class="p">(</span><span class="nv">define-aspect</span> <span class="nv">inspectable</span> <span class="nv">text</span><span class="p">)</span>
+<div class="codehilite"><pre><span/><span class="p">(</span><span class="nv">define-aspect</span> <span class="nv">inspectable</span> <span class="nv">text</span><span class="p">)</span>
 <span class="p">(</span><span class="nv">define-aspect</span> <span class="nv">readable</span> <span class="nv">text</span><span class="p">)</span>
 </pre></div>
 
 
 <p>Would macroexpand into something roughly like:</p>
-<div class="codehilite"><pre><span class="p">(</span><span class="nb">defclass</span> <span class="nv">inspectable</span> <span class="p">()</span>
+<div class="codehilite"><pre><span/><span class="p">(</span><span class="nb">defclass</span> <span class="nv">inspectable</span> <span class="p">()</span>
   <span class="p">((</span><span class="nv">inspectable/text</span> <span class="ss">:initarg</span> <span class="ss">:inspectable/text</span>
                      <span class="ss">:accessor</span> <span class="nv">inspectable/text</span><span class="p">)))</span>
 
@@ -66,7 +66,7 @@
 <p>You can include extra slot options when defining an aspect's slots, and they'll
 be passed along to the <code>defclass</code>.  This is especially handy for <code>:initform</code>
 and <code>:type</code>.</p>
-<div class="codehilite"><pre><span class="p">(</span><span class="nv">define-aspect</span> <span class="nv">container</span>
+<div class="codehilite"><pre><span/><span class="p">(</span><span class="nv">define-aspect</span> <span class="nv">container</span>
   <span class="p">(</span><span class="nv">contents</span> <span class="ss">:initform</span> <span class="no">nil</span><span class="p">))</span>
 
 <span class="p">(</span><span class="nv">define-aspect</span> <span class="nv">throwable</span>
@@ -81,7 +81,7 @@
 <p>When you define an aspect named <code>foo</code> Beast also defines a <code>foo?</code> predicate that
 returns <code>(typep object 'foo)</code>, which comes in handy when using higher-order
 functions:</p>
-<div class="codehilite"><pre><span class="p">(</span><span class="nb">defun</span> <span class="nv">whats-for-dinner?</span> <span class="p">()</span>
+<div class="codehilite"><pre><span/><span class="p">(</span><span class="nb">defun</span> <span class="nv">whats-for-dinner?</span> <span class="p">()</span>
   <span class="p">(</span><span class="nb">remove-if-not</span> <span class="nf">#'</span><span class="nv">edible?</span> <span class="p">(</span><span class="nv">container/contents</span> <span class="vg">*fridge*</span><span class="p">)))</span>
 </pre></div>
 
@@ -91,7 +91,7 @@
 them together.</p>
 <h3 id="defining-entities">Defining Entities</h3>
 <p>You define entity classes using <code>define-entity</code>:</p>
-<div class="codehilite"><pre><span class="p">(</span><span class="nv">define-entity</span> <span class="nv">dart</span> <span class="p">(</span><span class="nv">throwable</span><span class="p">))</span>
+<div class="codehilite"><pre><span/><span class="p">(</span><span class="nv">define-entity</span> <span class="nv">dart</span> <span class="p">(</span><span class="nv">throwable</span><span class="p">))</span>
 <span class="p">(</span><span class="nv">define-entity</span> <span class="nv">bread</span> <span class="p">(</span><span class="nv">edible</span><span class="p">))</span>
 <span class="p">(</span><span class="nv">define-entity</span> <span class="nv">pie</span> <span class="p">(</span><span class="nv">edible</span> <span class="nv">throwable</span><span class="p">))</span>
 <span class="p">(</span><span class="nv">define-entity</span> <span class="nv">icebox</span> <span class="p">(</span><span class="nv">container</span><span class="p">))</span>
@@ -100,7 +100,7 @@
 
 <p>The resulting classes will inherit from <code>entity</code> and each of the aspects (in
 order).  This example would expand (roughly) into:</p>
-<div class="codehilite"><pre><span class="p">(</span><span class="nb">defclass</span> <span class="nv">dart</span> <span class="p">(</span><span class="nv">entity</span> <span class="nv">throwable</span><span class="p">)</span> <span class="p">())</span>
+<div class="codehilite"><pre><span/><span class="p">(</span><span class="nb">defclass</span> <span class="nv">dart</span> <span class="p">(</span><span class="nv">entity</span> <span class="nv">throwable</span><span class="p">)</span> <span class="p">())</span>
 <span class="p">(</span><span class="nb">defun</span> <span class="nv">dart?</span> <span class="p">(</span><span class="nv">object</span><span class="p">)</span> <span class="p">(</span><span class="nb">typep</span> <span class="nv">object</span> <span class="ss">'dart</span><span class="p">))</span>
 
 <span class="p">(</span><span class="nb">defclass</span> <span class="nv">bread</span> <span class="p">(</span><span class="nv">entity</span> <span class="nv">edible</span><span class="p">)</span> <span class="p">())</span>
@@ -117,7 +117,7 @@
 <h3 id="entity-slot-definitions">Entity Slot Definitions</h3>
 <p>You can also specify slot definitions at the entity level, and they'll be passed
 along to <code>defclass</code>:</p>
-<div class="codehilite"><pre><span class="p">(</span><span class="nv">define-entity</span> <span class="nv">cheese</span> <span class="p">(</span><span class="nv">edible</span><span class="p">)</span>
+<div class="codehilite"><pre><span/><span class="p">(</span><span class="nv">define-entity</span> <span class="nv">cheese</span> <span class="p">(</span><span class="nv">edible</span><span class="p">)</span>
   <span class="p">(</span><span class="nv">variety</span> <span class="ss">:type</span> <span class="p">(</span><span class="nb">member</span> <span class="ss">:swiss</span> <span class="ss">:cheddar</span> <span class="ss">:feta</span><span class="p">)</span>
            <span class="ss">:initarg</span> <span class="ss">:variety</span>
            <span class="ss">:reader</span> <span class="ss">:cheese-variety</span><span class="p">))</span>
@@ -130,7 +130,7 @@
 <h3 id="creating-and-destroying-entities">Creating and Destroying Entities</h3>
 <p>After you've defined your entity classes you can can create some entities using
 <code>create-entity</code>:</p>
-<div class="codehilite"><pre><span class="p">(</span><span class="nb">defparameter</span> <span class="vg">*my-fridge*</span> <span class="p">(</span><span class="nv">create-entity</span> <span class="ss">'icebox</span><span class="p">))</span>
+<div class="codehilite"><pre><span/><span class="p">(</span><span class="nb">defparameter</span> <span class="vg">*my-fridge*</span> <span class="p">(</span><span class="nv">create-entity</span> <span class="ss">'icebox</span><span class="p">))</span>
 
 <span class="p">(</span><span class="nb">dotimes</span> <span class="p">(</span><span class="nv">i</span> <span class="mi">30</span><span class="p">)</span>
   <span class="p">(</span><span class="nb">push</span> <span class="p">(</span><span class="nv">create-entity</span> <span class="ss">'cheese</span>
@@ -150,7 +150,7 @@
 <p>Beast also defines two generic functions called <code>entity-created</code> and
 <code>entity-destroyed</code> which don't do anything by default, but are there for you to
 add methods on if you want.  For example:</p>
-<div class="codehilite"><pre><span class="p">(</span><span class="nv">define-aspect</span> <span class="nv">location</span> <span class="nv">x</span> <span class="nv">y</span><span class="p">)</span>
+<div class="codehilite"><pre><span/><span class="p">(</span><span class="nv">define-aspect</span> <span class="nv">location</span> <span class="nv">x</span> <span class="nv">y</span><span class="p">)</span>
 
 <span class="p">(</span><span class="nb">defvar</span> <span class="vg">*world*</span> <span class="p">(</span><span class="nb">make-array</span> <span class="p">(</span><span class="mi">100</span> <span class="mi">100</span><span class="p">)</span> <span class="ss">:initial-element</span> <span class="no">nil</span><span class="p">))</span>
 
@@ -169,7 +169,7 @@
 <p>A system is essentially a function that takes an entity as an argument with
 zero or more aspects as type specifiers.  When you run a system the function
 will be run on every entity that meet the requirements.  For example:</p>
-<div class="codehilite"><pre><span class="c1">; No specifiers, this just runs on every entity.</span>
+<div class="codehilite"><pre><span/><span class="c1">; No specifiers, this just runs on every entity.</span>
 <span class="p">(</span><span class="nv">define-system</span> <span class="nv">log-all-entities</span> <span class="p">(</span><span class="nv">entity</span><span class="p">)</span>
   <span class="p">(</span><span class="nb">print</span> <span class="nv">entity</span><span class="p">))</span>
 
@@ -189,7 +189,7 @@
 
 <p>Systems with more than one argument are currently supported, but should be
 considered experimental.  The API may change in the future.</p>
-<div class="codehilite"><pre><span class="c1">; Run on all PAIRS of entities that have the appropriate aspects.</span>
+<div class="codehilite"><pre><span/><span class="c1">; Run on all PAIRS of entities that have the appropriate aspects.</span>
 <span class="p">(</span><span class="nv">define-system</span> <span class="nv">detect-collisions</span> <span class="p">((</span><span class="nv">e1</span> <span class="nv">location</span> <span class="nv">collidable</span><span class="p">)</span>
                                   <span class="p">(</span><span class="nv">e2</span> <span class="nv">location</span> <span class="nv">collidable</span><span class="p">))</span>
   <span class="c1">; ...</span>
@@ -199,7 +199,7 @@
 
 <p><code>define-system</code> defines a function with the same name as the system, and
 a <code>run-...</code> function that will do the actual running for you:</p>
-<div class="codehilite"><pre><span class="p">(</span><span class="nv">define-system</span> <span class="nv">log-all-entities</span> <span class="p">(</span><span class="nv">entity</span><span class="p">)</span>
+<div class="codehilite"><pre><span/><span class="p">(</span><span class="nv">define-system</span> <span class="nv">log-all-entities</span> <span class="p">(</span><span class="nv">entity</span><span class="p">)</span>
   <span class="p">(</span><span class="nb">print</span> <span class="nv">entity</span><span class="p">))</span>
 
 <span class="p">(</span><span class="nv">run-log-all-entities</span><span class="p">)</span>