Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class AcidRing {
- PVector pos;
- float radius;
- float precision;
- float step;
- float angle;
- AcidRing(PVector _pos, float _radius, float _precision, float _angle) {
- pos = _pos.copy();
- radius = _radius;
- precision = _precision;
- angle = _angle;
- }
- void run() {
- int bsize = player.bufferSize();
- step = bsize/precision;
- pushMatrix();
- translate(pos.x, pos.y);
- rotate(angle);
- beginShape();
- noFill();
- stroke(170, 117, 67, 200);
- strokeWeight(2);
- for (int i = 0; i < precision; i++) {
- float x = cos(map(i, 0, precision, 0, HALF_PI)) * (radius + player.left.get(floor(map(i, 0, precision, 0, bsize)))*100);
- float y = sin(map(i, 0, precision, 0, HALF_PI)) * (radius + player.left.get(floor(map(i, 0, precision, 0, bsize)))*100);
- vertex(x, y);
- }
- endShape();
- popMatrix();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement