Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added warping

  • Loading branch information...
commit 3acfdfeb6a865e15ef29438e32fe88963590e901 1 parent 1fccc96
@mhenstell mhenstell authored
Showing with 66 additions and 1 deletion.
  1. +27 −0 WarpSpeedMrSulu.pde
  2. +37 −0 WarpStar.pde
  3. +2 −1  domeTransmitter.pde
View
27 WarpSpeedMrSulu.pde
@@ -0,0 +1,27 @@
+class WarpSpeedMrSulu extends Routine {
+ int NUM_STARS = 500;
+ WarpStar[] warpstars;
+
+ void setup(PApplet parent) {
+ super.setup(parent);
+ warpstars = new WarpStar[NUM_STARS];
+ for (int i = 0; i<NUM_STARS; i++) {
+ warpstars[i] = new WarpStar();
+ }
+ }
+
+ void draw() {
+ background(0);
+ stroke(255);
+
+ for (int i=0; i<NUM_STARS; i++) {
+ warpstars[i].draw();
+ }
+
+ if (frameCount - modeFrameStart > FRAMERATE*TYPICAL_MODE_TIME) {
+ newMode();
+ }
+ }
+
+
+}
View
37 WarpStar.pde
@@ -0,0 +1,37 @@
+class WarpStar {
+ float x;
+ float y;
+ float len;
+ float v;
+
+ public WarpStar() {
+ this.reset();
+ }
+
+ public void reset() {
+ x = int(random(0, WIDTH));
+ y = int(random(0, -100));
+
+ v = random(0, 1);
+ len = v * 5;
+ }
+
+ public void draw() {
+ y = y + v;
+
+ int r = int(map(y, 0, HEIGHT, 0, 255));
+ int g = 0;
+ int b = 0;
+
+ stroke(r, g, b);
+ point(x, y);
+
+ for (int i=0; i<len; i++) {
+ stroke(255 >> i / 2);
+ point(x, y - i);
+ }
+
+ if (y > HEIGHT) this.reset();
+ }
+}
+
View
3  domeTransmitter.pde
@@ -29,7 +29,8 @@ Routine[] enabledRoutines = new Routine[] {
new RGBRoutine(),
new FlashColors(),
new FollowMouse(),*/
- new Greetz()
+ // new Greetz(),
+ new WarpSpeedMrSulu()
};
int w = 0;
Please sign in to comment.
Something went wrong with that request. Please try again.