Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@foldi
foldi / README.md
Last active December 18, 2015 21:19
SimpleSim step 5

Step 5

  • Create a System._update() function to iterate over items and update their properties.
  • Create System._draw() and System.getCSSText() functions to update items' style properties and render them in the browser's viewport.
  • Add requestAnimFrame to create an animation loop.
@foldi
foldi / README.md
Last active December 18, 2015 21:19
SimpleSim step 4

Step 4

  • Create an Item class.
@foldi
foldi / README.md
Last active December 18, 2015 21:19
SimpleSim step 3

Step 3

  • Create a System.add() method to add items to World.
  • Should throw an Error: Item class does not exist.
@foldi
foldi / README.md
Last active December 18, 2015 21:19
SimpleSim step 2

Step 2

  • Create a World class.
  • Create Utils to hold utility functions.
@foldi
foldi / README.md
Last active December 18, 2015 21:18
SimpleSim step 1

Step 1

  • Create project files.
  • Create System class.
  • Should throw an Error: 'undefined' is not a constructor (evaluating 'new exports.World(world)')
@foldi
foldi / README.md
Last active December 18, 2015 09:49
FloraJS - Particle System + Repellers

Particle System + Repellers

@foldi
foldi / README.md
Last active December 18, 2015 09:49
FloraJS - Particle System + Attractors

Particle System + Attractors

@foldi
foldi / README.md
Last active December 18, 2015 09:49
FloraJS - Particle System

Particle System

@foldi
foldi / README.md
Last active December 18, 2015 09:49
FloraJS - Camera

Camera

In the above example, we have a fixed, third-person perspective of our World. But Flora can also provide a first-person perspective from the point of view of an Agent. Setting 'controlCamera' to 'true' on an agent will force Flora's camera to track that agent. Of course, there can only be one agent controlling the World's Camera.

@foldi
foldi / README.md
Last active December 18, 2015 09:49
FloraJS - Sensor, Stimuli and Proximity objects

A small World

Putting it all together, we can observe Agents navigate a World with multiple Stimuli and Proximity objects.