class ScoreBurst extends Particle { int val; ScoreBurst(PVector pos, int points) { super(pos, new PVector(0, 0), 90); val = points; } void draw() { fill(255, 255 * life / maxlife); noStroke(); ellipse(pos.x, pos.y, (val + 1) * (1 - 1.0*life/maxlife) * 10, (val + 1) * (1 - 1.0*life/maxlife) * 10); fill(255, 1000 * life / maxlife); textAlign(CENTER, CENTER); textFont(info_font, 16); if(val > 3) textFont(info_font, 32); text("+"+val, pos.x, pos.y); } } class Span implements Comparable { int pos; int len; int type; Span(int p, int l, int t) { pos = p; len = l; type = t; } float midAngle() { return wheel_angle + TWO_PI/SEGMENTS*(pos + len/2.0); } boolean equals(Object o) { if(o == null || !(o instanceof Span)) return false; Span other = (Span) o; return (pos == other.pos && len == other.len && type == other.type); } int hashCode() { return pos + 100*len + 10000*type; } int compareTo(Object o) { if(!(o instanceof Span)) throw new ClassCastException(); Span other = (Span) o; if(len > other.len) return -1; if(len < other.len) return 1; if(type > other.type) return -1; if(type < other.type) return 1; if(pos > other.pos) return -1; if(pos < other.pos) return 1; return 0; } }