Skip to content

Latest commit

 

History

History
 
 

boids

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Boids Example

Demo

A version of Boids implemented in Yew.

This example doesn't make use of a Canvas, instead, each boid has its own element demonstrating the performance of Yew's virtual DOM.

Running

You should run this example with the --release flag:

trunk serve --release

Concepts

The example uses gloo::timers implementation of setInterval to drive the Yew game loop.

Improvements

  • Add the possibility to switch the behaviour from flocking to scattering by inverting the cohesion rule so that boids avoid each other. This should also invert the color adaption to restore some variety.
  • Add keyboard shortcuts for the actions.
  • Make it possible to hide the settings panel entirely
  • Bigger boids should accelerate slower than smaller ones
  • Share settings by encoding them into the URL
  • Resize the boids when "Spacing" is changed. The setting should then also be renamed to something like "Size".