Unintended behavior with flocking boids simulation

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
karimjerbi
Prole
Posts: 1
Joined: Sat Mar 22, 2025 9:29 pm

Unintended behavior with flocking boids simulation

Post by karimjerbi »

Hello dear LÖVERS,
i am trying to recreate this p5.js snippet in love2d: https://editor.p5js.org/codingtrain/sketches/ry4XZ8OkN
My code seems to work fine, but when setting the variables to match the p5.js code, i get different behavior,
I think I have a bug somewhere in the Boid:cohesion method or my use of vectors is flawed(I am very bad at this).

Here is my file and thank you for taking the time to read this and helping me :awesome: !
boids.love
(3.34 KiB) Downloaded 35 times
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 3 guests