Skip to content

Latest commit

 

History

History
19 lines (18 loc) · 760 Bytes

README.md

File metadata and controls

19 lines (18 loc) · 760 Bytes

Boids in Vanilla JS Using Canvas

In this project I implemented the boid algorithm which simulates the flocking behaviour of birds.

Usage

You must include the script boidsMain.js and link boids.cssin your html file. Also, include the canvas element with the id 'boidsCanvas'.

   <head>
        <link rel="stylesheet" href="boids.css">
        <script type="module" src="boidsMain.js"></script>
    </head>
    <body>
        <canvas id="boidsCanvas"></canvas>
    </body>

Example

An example of the animation is on my personal website http://www.jakenieto.com. If you click the background a new flock of boids is generated.

Inspiration

I got my inspiration for this project here https://p5js.org/examples/simulate-flocking.html.