MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / Ball

Function Ball

assets/js/Mousehover.js:36–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34}
35
36function 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
54var bal = [];
55for (var i=0; i<50; i++){

Callers

nothing calls this directly

Calls 1

randomColorFunction · 0.70

Tested by

no test coverage detected