terra/index.html

105 lines
3.6 KiB
HTML
Raw Normal View History

2014-03-10 03:57:59 +00:00
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
2014-08-17 03:23:48 +00:00
<title>terra.js</title>
<link rel="stylesheet" href="main.css">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
2014-03-10 03:57:59 +00:00
</head>
<body>
2014-08-17 03:23:48 +00:00
<div class="fullPage splash">
<div class="vcent"></div>
<header id="header">
<h1>terra.js <span>alpha</span></h1>
<p>A JavaScript framework for simple biological simulations and cellular automata.</p>
<a data-scroll href="#main" class="downArrow"></a>
</header>
</div>
<nav>
<ul>
<li><a data-scroll href="#usage">Usage</a></li>
<li><a data-scroll href="#examples">Examples</a></li>
<li><a data-scroll href="#options">Options</a></li>
<li><a data-scroll href="#methods">Methods</a></li>
<li><a data-scroll href="#events">Events</a></li>
<li><a href="https://github.com/rileyjshaw/terra">GitHub</a></li>
</ul>
</nav>
<div id="main" class="main">
<p>terra is a <strong>super customizable</strong> framework for creating and analyzing biological simulations. It's open-source and licenced under MIT.</p>
<p>terra is still in Alpha version, which means...</p>
<h2 id="usage">Usage</h2>
<p>To get started, we'll create a simple creature using the creatureFactory. Each creature requires a type and a color.</p>
<pre>creatureFactory.register({
type: 'firstCreature',
color: [220, 85, 79]
});</pre>
<p>This creature is valid, but it's just inheriting the default behaviours. To make a more interesting creature, let's override some of the default <a data-scroll href="#options">options</a> and <a data-scroll href="#methods">methods</a>.</p>
<pre>creatureFactory.register({
type: 'secondCreature',
color: [41, 128, 185],
metabolism: 1,
sustainability: 3,
reproduceLv: 0.60,
etc...
});</pre>
<p>We've just created a creature that will ____.</p>
<p>To run a simulation, we'll need to create an environment. Let's make a 25x25 grid and populate 40% of the space with our first creature and 20% with our second.</p>
<pre>var ex1 = new Terrarium(25, 25, 'ex1');
ex1.populate([['firstCreature', 40], ['secondCreature', 20]]);</pre>
<h2 id="examples">Examples</h2>
<h3 id="gol">Conway's Game of Life <a class="question" target="_blank" href="http://en.wikipedia.org/wiki/Conway's_Game_of_Life">?</a></h3>
<p>terra can also run cellular automata. </p>
<pre><code>
</code></pre>
<h2 id="options">Options</h2>
<p>The following options can be passed in an object to creatureFactory.register( ) as the first argument.</p>
<h3>Required</h3>
<ul>
<li>(string) type: </li>
</ul>
<h3>Optional</h3>
<ul>
<li>(array) color: </li>
<li>(int) initialEnergy: </li>
<li>(int) maxEnergy: </li>
<li>(int) metabolism: </li>
<li>(int) size: </li>
<li>(int) speed: </li>
<li>(int) vision: </li>
<li>(int) sustainability: 2</li>
<li>(float) reproduceLv: 0.70</li>
<li>(float) moveLv: 0.20</li>
<li>(char) character: </li>
</ul>
<h2 id="methods">Methods</h2>
<ul>
<li>queue</li>
<li>reproduce</li>
<li>move</li>
<li>wait</li>
<li>isDead</li>
<li>boundEnergy</li>
</ul>
<h2 id="events">Events</h2>
<ul>
<li>finished</li>
</ul>
</div>
<footer>Created with ❤ by <a href="http://rileyjshaw.com">rileyjshaw</a>. Inspired by <a href="http://eloquentjavascript.net/">Marijn Haverbeke</a> and <a href="https://www.wolframscience.com/">Stephen Wolfram</a>.</footer>
<script src="terra.demo.min.js"></script>
2014-03-10 03:57:59 +00:00
</body>
</html>