First time submitting a challenge here, if anyone can let me know of any sites that can run my processing script instead of having everyone else copy/paste my code I would be very grateful! I do have an account with open processing, but it will not run this code for some reason. Feedback is appreciated!

Edit: Video

`ParticleSystem ps; void setup() { size(640, 400); background(255); ps = new ParticleSystem(); } void draw() { background(255); ps.run(); buttons(); //GUI stroke(127); fill(200); rect(540, 0, 100, height); fill(0); text("Point1 x velocity", 540, 10); text(ps.v1.x, 570, 25); text("Point1 y velocity", 540, 50); text(ps.v1.y, 570, 65); text("Point2 x velocity", 540, 90); text(ps.v2.x, 570, 105); text("Point2 y velocity", 540, 130); text(ps.v2.y, 570, 145); text("Color r velocity", 540, 170); text(ps.v3.x, 570, 185); text("Color g velocity", 540, 210); text(ps.v3.y, 570, 225); text("Color b velocity", 540, 250); text(ps.v3.z, 570, 265); text("Life Span", 540, 290); text((int)ps.maxlife, 570, 305); fill(127); rect(545, 15, 10, 10); rect(625, 15, 10, 10); rect(545, 55, 10, 10); rect(625, 55, 10, 10); rect(545, 95, 10, 10); rect(625, 95, 10, 10); rect(545, 135, 10, 10); rect(625, 135, 10, 10); rect(545, 175, 10, 10); rect(625, 175, 10, 10); rect(545, 215, 10, 10); rect(625, 215, 10, 10); rect(545, 255, 10, 10); rect(625, 255, 10, 10); rect(545, 295, 10, 10); rect(625, 295, 10, 10); } void buttons() { // Button functionality if (mousePressed == true) { //v1 x velocity if ((mouseX > 545 && mouseX < 555) && (mouseY > 15 && mouseY < 25)) { ps.v1.x -= 0.0003; } if ((mouseX > 625 && mouseX < 635) && (mouseY > 15 && mouseY < 25)) { ps.v1.x += 0.0003; } //v1 y velocity if ((mouseX > 545 && mouseX < 555) && (mouseY > 55 && mouseY < 65)) { ps.v1.y -= 0.0003; } if ((mouseX > 625 && mouseX < 635) && (mouseY > 55 && mouseY < 65)) { ps.v1.y += 0.0003; } //v2 x velocity if ((mouseX > 545 && mouseX < 555) && (mouseY > 95 && mouseY < 105)) { ps.v2.x -= 0.0003; } if ((mouseX > 625 && mouseX < 635) && (mouseY > 95 && mouseY < 105)) { ps.v2.x += 0.0003; } //v2 y velocity if ((mouseX > 545 && mouseX < 555) && (mouseY > 135 && mouseY < 145)) { ps.v2.y -= 0.0003; } if ((mouseX > 625 && mouseX < 635) && (mouseY > 135 && mouseY < 145)) { ps.v2.y += 0.0003; } //v3 x velocity if ((mouseX > 545 && mouseX < 555) && (mouseY > 175 && mouseY < 185)) { ps.v3.x -= 0.0003; } if ((mouseX > 625 && mouseX < 635) && (mouseY > 175 && mouseY < 185)) { ps.v3.x += 0.0003; } //v3 y velocity if ((mouseX > 545 && mouseX < 555) && (mouseY > 215 && mouseY < 225)) { ps.v3.y -= 0.0003; } if ((mouseX > 625 && mouseX < 635) && (mouseY > 215 && mouseY < 225)) { ps.v3.y += 0.0003; } //v3 z velocity if ((mouseX > 545 && mouseX < 555) && (mouseY > 255 && mouseY < 265)) { ps.v3.z -= 0.0003; } if ((mouseX > 625 && mouseX < 635) && (mouseY > 255 && mouseY < 265)) { ps.v3.z += 0.0003; } //lifespan if ((mouseX > 545 && mouseX < 555) && (mouseY > 295 && mouseY < 305)) { ps.maxlife -= 0.3; } if ((mouseX > 625 && mouseX < 635) && (mouseY > 295 && mouseY < 305)) { ps.maxlife += 0.3; } } } class Line { //line's points PVector t1; // time for point 1 PVector n1;// noise for point 1 PVector pos1;// position for point 1 PVector t2;// time for point 2 PVector n2;// noise for point 2 PVector pos2; // position for point 2 //line's stroke PVector t3; // time for stroke color PVector n3; // noise for stroke color color col; // stroke color //lifespan float lifespan; // alpha for stroke color float maxlife; Line(PVector t1_, PVector t2_, PVector t3_, float lifespan_) { t1 = t1_; t2 = t2_; t3 = t3_; lifespan = lifespan_; maxlife = 255; n1 = new PVector(noise(t1.x), noise(t1.y)); n2 = new PVector(noise(t2.x), noise(t2.y)); pos1 = new PVector(map(n1.x, 0, 1, 0, width), map(n1.y, 0, 1, 0, height)); pos2 = new PVector(map(n2.x, 0, 1, 0, width), map(n2.y, 0, 1, 0, height)); n3 = new PVector(noise(t3.x), noise(t3.y), noise(t3.z)); col = color(map(n3.x, 0, 1, 0, 255), map(n3.y, 0, 1, 0, 255), map(n3.z, 0, 1, 0, 255)); } void run() { display(); lifespan -= 2; } void display() { stroke(col, map(lifespan, 0, 255, 0, maxlife)); line(pos1.x, pos1.y, pos2.x, pos2.y); } boolean isDead() { if (lifespan < 1) { return true; } else { return false; } } } class ParticleSystem { ArrayList<Line> lines; // ArrayList of Line objects PVector v1; // velocity of PVector 1 PVector v2; // velocity of PVector 2 PVector v3; // velocity of PVector 3 float maxlife; // max lifespan mapped between 0 and 255 ParticleSystem() { lines = new ArrayList<Line>(); v1 = new PVector(0.006, 0.006); v2 = new PVector(0.006, 0.006); v3 = new PVector(0.006, 0.006, 0.006); maxlife = 255; } void run() { // update and addLine methods update(); addLine(); } void addLine() { if (lines.size() < 1) { // if there are no Line objects // create random time PVectors lines.add(new Line(new PVector(random(0, 100000), random(0, 100000)), new PVector(random(0,100000), random(0, 100000)), new PVector(random(0,100000), random(0, 100000), random(0, 100000)), maxlife)); } else if (lines.size() < 500) { // else if there are less than some number // create a new Line objects with the previous line's time PVectors with added // velocity Line last = lines.get(lines.size() - 1); lines.add(new Line(last.t1.add(v1), last.t2.add(v2), last.t3.add(v3), maxlife)); } } void update() { // executes each Line object's run function and checks for dead Lines for (int i = lines.size() - 1; i >= 0; i--) { Line l = lines.get(i); l.run(); if (l.isDead()) { lines.remove(l); } } } } `

[link] [comments]