var mytext="HAPPY\n2018";
createCanvas(windowWidth, windowHeight);
colorMode(HSB,360,255,255,255);
for (var i = 0; i < 5; i++) {
var mSeeker = new Seeker();
mSeeker.position = createVector(int(random(w)), int(random(h)));
seekersArray.push(mSeeker);
if(mytext=="ALICE")mytext="HAPPY\n2018";
for (var i = 0; i < nworms; i++) {
var mSeeker = seekersArray[i];
sheet=createGraphics(windowWidth, windowHeight);
sheet.textSize(int(windowWidth*.2));
sheet.textAlign(CENTER,CENTER);
sheet.text(mytext, sheet.width/2, sheet.height/2);
seekersArray = new Array(nworms);
this.position = createVector(random(w), random(h));
this.speed = createVector(random(-3, 3), random(-3, 3));
this.dia = random(windowWidth*.004);
this.inertia = random(-2, 2) + 12;
this.radius = random(15, 25);
this.hue=random(1)>.8?random(65):60;
if(random(1)>.99)this.hue=random(360);
this.wandertheta=random(TWO_PI);
this.lightchange=random(30,40);
this.permanent=(random(1)>.98&&this.dia<5);
Seeker.prototype.dessin = function() {
this.change=random(-1.5,1.5);
this.wandertheta+=this.change;
var vise = createVector(this.radius*sin(this.wandertheta+this.speed.heading()), this.radius*cos(this.wandertheta+this.speed.heading()));
deviation = this.speed.copy();
deviation.setMag(devMax);
this.position.add(deviation);
this.positionBrightness = this.getSourcePixelBrightness();
if ((this.position.x < 1) || (this.position.y < 1) || (this.position.x > w - 1) || (this.position.y > h - 1))
if (this.positionBrightness>250||(this.trans<255&&this.trans>0)||this.permanent) {
this.trans+=this.lightchange;
if(this.trans>240)this.up=false;
this.trans-=this.lightchange;
if(this.trans<0)this.up=true;
fill(this.hue,255,255, this.trans);
translate(this.position.x, this.position.y);
rotate(this.speed.heading());
ellipse(-this.dia*.5,0,this.dia,this.dia);
ellipse(this.dia*.5,0,this.dia,this.dia);
Seeker.prototype.deplace = function() {
this.position = createVector(random(1, w - 1), random(1, h - 1));
this.seek = this.position.copy();
Seeker.prototype.getSourcePixelBrightness = function() {
var pos = 4 * (floor(this.position.x) + floor(this.position.y) * w);