-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspiral.pde
37 lines (35 loc) · 1.11 KB
/
spiral.pde
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
class Spiral {
float x;
float y;
float speed;
float angDiff;
float size;
float startAng;
float delay;
float repetitions;
float[] bullColor;
int lastLoop = 0;
float lastDelay = millis();
Spiral(float x, float y, float speed, float angDiff, float size, float startAng, float delay, float repetitions, float[] bullColor){
this.x = x;
this.y = y;
this.speed = speed;
this.angDiff = angDiff;
this.size = size;
this.startAng = startAng;
this.delay = delay;
this.repetitions = repetitions;
this.bullColor = bullColor;
}
// Spawns the bullets when the spiral pattern is triggered
void draw(){
if (((millis() - lastDelay) > delay) && repetitions > 0) {
XBullet b = new XBullet(x,y,speed,speed,startAng+(angDiff*lastLoop),size,20,bullColor);
pattern3.add(b);
pattern3Coll.add(new CollisionCircle(b.x, b.y, b.radius));
lastDelay = millis();
lastLoop += 1;
repetitions -= 1;
}
}
}