Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 41 lines (35 sloc) 0.533 kb
a6b64d89 »
2012-05-15 Refactored everything into separate classes.
1 class Burst {
2 float x;
3 float y;
4 float d;
5 float maxd;
6 float speed;
7 int intensity;
8
9 public Burst()
10 {
11 init();
12 }
13
14 public void init()
15 {
16 x = random(WIDTH);
17 y = random(HEIGHT);
18 maxd = random(10);
19 speed = random(5)/10 + 0.1;
20 d = 0;
21 intensity = 255;
22 }
23
24 public void draw(boolean fl)
25 {
26 if (fl)
27 fill(0);
28 else
29 noFill();
30 stroke(intensity);
31 ellipse(x, y, d, d);
32 d+= speed;
33 if (d > maxd)
34 intensity -= 15;
35
36 if (intensity <= 0)
37 init();
38 }
39 }
40
Something went wrong with that request. Please try again.