Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions LEDStripController.pde
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ void keyPressed(){
Wipe wipe = new Wipe(2000, selectedColor);
effects.add(wipe);
}

if(key == 'u') {
Supernova supernova = new Supernova(3000);
effects.add(supernova);
}

}

Expand Down
37 changes: 37 additions & 0 deletions Supernova.pde
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
class Supernova extends Effect{
float w, h;
float x, y;

Supernova(int _millis){
super(_millis);

w = 0;
h = 0;
x = cols/2;
y = rows/2;

imageBuffer.beginDraw();
imageBuffer.rectMode(CENTER);
imageBuffer.noFill();
imageBuffer.endDraw();

imageBuffer.beginDraw();
imageBuffer.stroke(random(155,255),random(155,255),random(155,255));
imageBuffer.background(0,0);
imageBuffer.rect(x,y,w,h);
imageBuffer.ellipse(x,y,w,h);
imageBuffer.endDraw();

}

void update(){
imageBuffer.beginDraw();
imageBuffer.stroke(random(5,255),random(155,255),random(5,255));
imageBuffer.background(0,0);
imageBuffer.rect(x,y,w,h);
imageBuffer.ellipse(x,y,w,h);
imageBuffer.endDraw();
w++;
h++;
}
}
2 changes: 1 addition & 1 deletion Wipe.pde
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ class Wipe extends Effect {
imageBuffer.endDraw();
xpos++;
}
}
}
2 changes: 2 additions & 0 deletions sketch.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mode.id=processing.mode.java.JavaMode
mode=Java
Loading