mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-07-05 01:10:27 -04:00
WineGums example: rename function.
This commit is contained in:
parent
6c7c4d0798
commit
4751fc6dc8
1 changed files with 4 additions and 3 deletions
|
@ -39,14 +39,14 @@
|
||||||
|
|
||||||
Ball.prototype = {
|
Ball.prototype = {
|
||||||
iterate: function() {
|
iterate: function() {
|
||||||
this.checkWallCollision();
|
this.checkBorders();
|
||||||
if (this.vector.length > this.maxVec)
|
if (this.vector.length > this.maxVec)
|
||||||
this.vector.length = this.maxVec;
|
this.vector.length = this.maxVec;
|
||||||
this.point += this.vector;
|
this.point += this.vector;
|
||||||
this.updateShape();
|
this.updateShape();
|
||||||
},
|
},
|
||||||
|
|
||||||
checkWallCollision: function() {
|
checkBorders: function() {
|
||||||
var size = view.size;
|
var size = view.size;
|
||||||
if (this.point.x < -this.radius)
|
if (this.point.x < -this.radius)
|
||||||
this.point.x = size.width + this.radius;
|
this.point.x = size.width + this.radius;
|
||||||
|
@ -128,7 +128,8 @@
|
||||||
angle: 360 * Math.random(),
|
angle: 360 * Math.random(),
|
||||||
length: Math.random() * 10
|
length: Math.random() * 10
|
||||||
});
|
});
|
||||||
balls.push(new Ball(Math.random() * 60 + 60, position, vector));
|
var radius = Math.random() * 60 + 60;
|
||||||
|
balls.push(new Ball(radius, position, vector));
|
||||||
}
|
}
|
||||||
|
|
||||||
function onFrame() {
|
function onFrame() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue