5 private float brightness;
6 private float currTime;
7 private float currMaxBurstTime;
8 private float currMaxBrightness;
9 private float maxBurstTime;
10 private float peakTime;
11 private float peakDur;
12 private boolean stop =
false;
25 private void newBurst() {
30 currMaxBurstTime = maxBurstTime * 0.25f + (float) Math.random() * maxBurstTime * 0.75f;
32 currMaxBrightness = (float) Math.random() * 0.5f + 0.75f;
34 if (currMaxBrightness > 1) currMaxBrightness = 1;
39 peakDur = currMaxBurstTime / 20f;
42 angle = (float) Math.random() * 360f;
47 return brightness * currMaxBrightness;
62 if (currTime > currMaxBurstTime) {
66 if (currTime > peakTime + peakDur){
68 brightness -=
amount /
Math.max(0.1f, 0.25f - peakTime - peakDur);
69 if (brightness < 0) brightness = 0;