pop.touch.js 500 B

123456789101112131415161718192021222324252627
  1. POP.Touch = function(x, y) {
  2. this.x = x;
  3. this.y = y;
  4. this.r = 10;
  5. this.opacity = 1;
  6. this.remove = false;
  7. this.render = function() {
  8. if (this.remove) {
  9. return;
  10. }
  11. if (this.opacity < 0.1 ) {
  12. this.remove = true;
  13. } else {
  14. POP.draw.circle(this.x, this.y, this.r,
  15. 'rgba(255,0,0,' + this.opacity + ')');
  16. this.opacity = this.opacity - 0.05;
  17. }
  18. };
  19. };