Engineering a Paintbrush Made of Light: Day 5

All in all, its been a fun time here at FabLab SD. We started with playing around with wiimotes and ended up with a program we wrote by ourselves we could use with a wiimote or mouse. Most of the learning I had experienced ended up being in processing. At first, I thought it wouldn’t be much fun because it seemed too overly-simple. I soon learned that it was as open-ended as C++, and even better to use. It’s so easy to see immediate results, and you can do so much more than write a text-based program in the first day. Today, I’ve learned about arrays and how they work. It’s extremely complex and allows for a lot of possibilities, especially paired up with classes and dot syntax. I’m currently having problems with a program of my own, and I think that as I learn more, I’ll be able to debug it until it’s finally done. Anyone wanna help?
p[1].s2[1] is updating even though settable=false.

——————————————————————————————————-
En en;
Mvr[] p=new Mvr[4];
int si=0;

void setup(){
size(1000,750);
smooth();
en=new En();
for(int i=0;i<p.length;i++){
p[i]=new Mvr();
}
}

void draw(){
noStroke();
fill(255);
rect(0,0,width,height);
en.move();
for(int i=0;i

=10){
si=0;
fill(255,0,0);
ellipse(mouseX,mouseY,20,20);
}
}
println(p[1].s2[1]);
}

class En{

PVector a,v,l;

En(){
noStroke();
fill(0,100);
l=new PVector(500,200);
v=new PVector(0,0);
}

void move(){
//if(l.x0&&l.y0){
PVector rand=new PVector(mouseX,0);
/*}else if(l.x=100{
rand=new PVector(-1,random(-1,1));
}else if(l.y=100{
rand=new PVector(random(-1,1),-1);*/
PVector d=PVector.sub(rand,l);
d.normalize();
d.mult(2);
a=d;
v.add(a);
v.limit(20);
l.add(v);

fill(0,100);
rectMode(CENTER);
rect(l.x,l.y,100,100);
rectMode(CORNER);

if(l.xwidth){
v.x=-v.x;
}

if(l.yheight){
v.y=-v.y;
}
}
}

class Mvr{

PVector l,v,a,s,mo;
color c;
float lim,sze,mass,surprise;
int shott;
PVector s2[]=new PVector[6];
boolean settable[]=new boolean[6];

Mvr(){
noStroke();
l=new PVector(random(1000),random(750));
v=new PVector(0,0);
s=new PVector(0,0);
sze=20;
mass=sze;
lim=mass/4;
c=color(0,100);
//surprise=random(50);
for(int i=0;i<settable.length;i++){
settable[i]=true;
}
}

void move(){
mo=new PVector(mouseX,mouseY);
PVector m= new PVector(en.l.x,en.l.y);
PVector d= PVector.sub(m,l);
d.normalize();
d.mult(.75);
a=d;
v.add(a);
//v.limit(mass);
v.limit(20);
l.add(v);
s=PVector.sub(l,mo);

fill(c);
/*if(surprise<1){
rectMode(CENTER);
rect(l.x,l.y,sze,sze);
//face
fill(0);
rect(l.x-10,l.y-10,5,5);
rect(l.x+10,l.y-10,5,5);
ellipse(l.x,l.y+5,10,10);
//exclaim
fill(255,0,0,100);
rect(l.x+sze/1.5,l.y,10,10);
rect(l.x+sze/1.5,l.y-50,10,50);
rectMode(CORNER);
}else{*/
rectMode(CENTER);
rect(l.x,l.y,sze,sze);
rectMode(CORNER);
//}

if(l.xwidth){
v.x=-v.x;
}

if(l.yheight){
v.y=-v.y;
}
}

void shoot(){
for(int i=0;i<s2.length;i++){
if(settable[i]=true){
s2[i]=s;
settable[i]=false;
}
/*pushMatrix();
translate(l.x,l.y);
rotate(radians(??));*/

/*PVector m= new PVector(en.l.x,en.l.y);
PVector d= PVector.sub(m,l);
d.normalize();
d.mult(.75);
a=d;
v.add(a);
//v.limit(mass);
//v.limit(20);
l.add(v);}*/
}
}
}