//BlobMaze class Color { float r, g, b, a; Color() { r = random(0, 255); g = random(0, 255); b = random(0, 255); a = 255;//random(na, 255); } Color( float nr, float ng, float nb, float na) { r = nr; g = ng; b = nb; a = na; } boolean equals(Color t) { float pixelError = 2.0; if( abs(t.r-r) < pixelError && abs(t.g-g) < pixelError && abs(t.b-b) < pixelError ) return true; return false; } float getR() { return r; } float getG() { return g; } float getB() { return b; } float getA() { return a; } } class World { Maze worldMaze; int complexity; int depth; World( int c, int d ) { complexity = c; depth = d; worldMaze = new Maze(complexity, depth); } void render() { // Render our current maze position worldMaze.render(); } void update() { worldMaze.update(); } void mouseClick(int x, int y) { if(worldMaze.isDone()) worldMaze = new Maze(complexity, ++depth); else worldMaze.mouseClick(x, y); } void mouseMove(int x, int y) { /* for( int i = 0; i < Blobs.size(); ++i) { if(((Blob)Blobs.get(i)).inside(x, y)) { ((Blob)Blobs.get(i)).animate(1); break; } }*/ } } World myWorld; void setup() { size(400, 400); frameRate(40); smooth(); myWorld = new World(2,1); } void draw() { myWorld.update(); myWorld.render(); } void mouseMoved() { myWorld.mouseMove(mouseX, mouseY); } void mousePressed() { myWorld.mouseClick(mouseX, mouseY); }