Skip to content

My own implementation of the boid algorithm, which simulates the flocking behaviour of birds using vanilla JS and canvas

Notifications You must be signed in to change notification settings

jakenieto/boids-vanillaJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 

Repository files navigation

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.

About

My own implementation of the boid algorithm, which simulates the flocking behaviour of birds using vanilla JS and canvas

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published