()
| 34 | } |
| 35 | |
| 36 | function Ball() { |
| 37 | this.color = randomColor(); |
| 38 | this.radius = Math.random() * 20 + 14; |
| 39 | this.startradius = this.radius; |
| 40 | this.x = Math.random() * (tx - this.radius * 2) + this.radius; |
| 41 | this.y = Math.random() * (ty - this.radius); |
| 42 | this.dy = Math.random() * 2; |
| 43 | this.dx = Math.round((Math.random() - 0.5) * 10); |
| 44 | this.vel = Math.random() /5; |
| 45 | this.update = function() { |
| 46 | c.beginPath(); |
| 47 | c.arc(this.x, this.y, this.radius, 0, 2 * Math.PI); |
| 48 | c.fillStyle = this.color; |
| 49 | c.fill(); |
| 50 | |
| 51 | }; |
| 52 | } |
| 53 | |
| 54 | var bal = []; |
| 55 | for (var i=0; i<50; i++){ |
nothing calls this directly
no test coverage detected