This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//JSON | |
var params = { | |
mode: 0, | |
mouseMode: false, //it's "," | |
angleAdj: 63, | |
maxSpeed: 1, //it's "," | |
maxSteerForce: 0.01, | |
sizeAdj: 0.3, | |
red: 255, | |
green: 100, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var points = []; | |
var RESOLUTION = 50; | |
var rows, cols; | |
var linePoints = []; | |
function setup() { | |
createCanvas(500, 600); | |
background(0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//JSON | |
var params = { | |
casualMode: false, | |
patternMode: false, | |
mouseMode: false, //it's "," | |
angleAdj: 63, | |
maxSpeed: 1, //it's "," | |
maxSteerForce: 0.01, | |
sizeAdj: 1, | |
red: 255, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//JSON | |
var params = { | |
mouseMode: false, //it's "," | |
maxSpeed: 1, //it's "," | |
maxSteerForce: 0.01, | |
sinAdj: 1, | |
red: 255, | |
green: 100, | |
blue: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
class Boid { | |
constructor(x, y) { | |
this.pos = createVector(x, y); | |
this.vel = createVector(random(-1, 1), random(-1, 1)); | |
this.acc = createVector(); | |
this.maxSpeed = 3; // max speed; | |
this.maxSteerForce = 0.05; // max steering force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict" | |
class Thread { | |
constructor(_pos, h, s, b) { | |
this.pos = _pos.copy(); | |
this.vel = createVector(random(-5, 5), random(-5, 5)); | |
this.acc = createVector(); | |
this.angle = 0; | |
this.maxDesiredVelocity = random(0.1, 5); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
class Vehicle { | |
constructor(x, y, h, s, b) { | |
this.pos = createVector(x, y); | |
this.vel = createVector(random(-10, 10), random(-10, 10)); | |
this.acc = createVector(); | |
this.angle = 0; | |
this.maxDesiredVelocity = random(0.1, 1); | |
this.maxSteerForce = random(1, 10); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
class Vehicle { | |
constructor(x, y, h, s, b) { | |
this.pos = createVector(x, y); | |
this.vel = createVector(random(-5, 5), random(-5, 5)); | |
this.acc = createVector(); | |
this.angle = 0; | |
this.maxDesiredVelocity = random(0.1, 1); | |
this.maxSteerForce = random(1, 10); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
class Ball { | |
constructor(x, y, c) { | |
this.pos = createVector(x, y); | |
this.vel = createVector(0, 0); | |
this.acc = createVector(); | |
this.mass = random(5, 30); | |
this.rad = this.mass; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
class Ball { | |
constructor(x, y, c) { | |
this.pos = createVector(x, y); | |
this.vel = createVector(2, 2); | |
this.acc = createVector(); | |
this.mass = random(5, 30); | |
this.rad = this.mass; |
NewerOlder