Advertisement
Guest User

Untitled

a guest
Jun 8th, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. class AcidRing {
  2.  
  3. PVector pos;
  4. float radius;
  5. float precision;
  6. float step;
  7. float angle;
  8.  
  9. AcidRing(PVector _pos, float _radius, float _precision, float _angle) {
  10. pos = _pos.copy();
  11. radius = _radius;
  12. precision = _precision;
  13. angle = _angle;
  14. }
  15.  
  16. void run() {
  17. int bsize = player.bufferSize();
  18. step = bsize/precision;
  19. pushMatrix();
  20. translate(pos.x, pos.y);
  21. rotate(angle);
  22. beginShape();
  23. noFill();
  24. stroke(170, 117, 67, 200);
  25. strokeWeight(2);
  26. for (int i = 0; i < precision; i++) {
  27. float x = cos(map(i, 0, precision, 0, HALF_PI)) * (radius + player.left.get(floor(map(i, 0, precision, 0, bsize)))*100);
  28. float y = sin(map(i, 0, precision, 0, HALF_PI)) * (radius + player.left.get(floor(map(i, 0, precision, 0, bsize)))*100);
  29. vertex(x, y);
  30. }
  31. endShape();
  32. popMatrix();
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement