add spinnerdelay option

This commit is contained in:
yugecin
2016-10-01 13:44:34 +02:00
parent eee65a589e
commit be599885f5
3 changed files with 26 additions and 1 deletions

View File

@@ -22,6 +22,7 @@ public abstract class Spinner {
private double[][] points;
private int length;
private int index;
private int delay;
public static int DELAY = 3;
public abstract void init();
@@ -32,7 +33,10 @@ public abstract class Spinner {
}
public double[] getPoint() {
index = ++index % length;
if (delay++ < DELAY) {
index = ++index % length;
delay = 0;
}
return points[index];
}