Tweak to wrapdistf
authorMark Slee <mcslee@Mark-Slees-MacBook-Pro.local>
Sun, 11 Aug 2013 06:56:45 +0000 (23:56 -0700)
committerMark Slee <mcslee@Mark-Slees-MacBook-Pro.local>
Sun, 11 Aug 2013 06:56:45 +0000 (23:56 -0700)
TestPatterns.pde

index c247e2ca66f2eb3dff1a6a1c939dc0bde1c33ace..38ea2296200d31e7f13e370a7d1f3acc35a7df7d 100644 (file)
@@ -83,18 +83,16 @@ class TestTowerPattern extends SCPattern {
   public TestTowerPattern(GLucose glucose) {
     super(glucose);
     addModulator(towerIndex).trigger();
-    towerIndex.setValue(9);
   }
 
   public void run(int deltaMs) {
-    println((int)towerIndex.getValuef());
     int ti = 0;
     for (Tower t : model.towers) {
       for (Point p : t.points) {
         colors[p.index] = color(
           lx.getBaseHuef(),
           100,
-          max(0, 100 - 80*abs(ti - towerIndex.getValuef()))
+          max(0, 100 - 80*LXUtils.wrapdistf(ti, towerIndex.getValuef(), model.towers.size()))
         );
       }
       ++ti;