Inspiration

One of us stumbled upon a cool video on swarm intelligence on youtube and we all thought it was really cool and pretty. We thought that we could implement a flocking algorithm in a simple game to make it look nice.

What it does

It is a simple WebGame coded in JavaScript where the goal is to survive as long as possible. You control the leader boid (green) with the arrows and to survive, you need to always have follower boids (white) around you. The white boids follow you with swarm intelligence but they might escape your flock if you're going too fast or too slow. There are obstacles (red circles) which kill your followers or yourself if there is a collision and pieces of food (green circles) which will increase your score to let you spawn other followers around you (space bar).

How we built it

We used JavaScript with the library p5.js which is really well built to handle vectors and graphics (what we used the most)

Challenges we ran into

At first, we wanted to code our flocking algorithm on our own and ran into lots of balance problems with the coefficients and decided to borrow the code for our Boid class from the p5.js example, we modified it afterward so that it can be used in the game. After having the boids on our screen, we still weren't sure what kind of game we wanted to code and we decided to develop this one and a pong clone (implementing boids). We only kept this one on our submission.

Accomplishments that we're proud of

Our game looks nice ! Our logo too !

What we learned

p5.js is a really cool library for basic stuff but we ran into so much problems to use it in our code that it was a waste of time after all. We could have built classes for Vectors and Graphics in less time that it took us to make p5.js work.

What's next for World of Boids

If we export the flocking mechanism to some original idea for a game, it could be built on an app for iOS and Android and reach more users than a web game.

Built With

Share this project:

Updates