Skip to content

Commit b6d1b26

Browse files
Fixed es6 error
1 parent 041272f commit b6d1b26

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ animation.run();
6363

6464

6565
## Release History
66-
* 1.0.1 to 1.05
66+
* 1.0.1 to 1.06
6767
* Just updating readme file
6868
* 1.0.0
6969
* First release

node.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default class Node {
1818
this.level = 0;
1919
}
2020

21-
setPosition = function () {
21+
setPosition() {
2222
this.position = new Vector(this.parent.position.x + Random.range(-50, 50), this.parent.position.y + Random.range(-50, 50));
2323
}
2424

@@ -27,7 +27,7 @@ export default class Node {
2727
this.startDistance = Vector.distance(this.position,this.destination);
2828
}
2929

30-
setRandomDestination = function () {
30+
setRandomDestination() {
3131
var dX = 0;
3232
var dY = 0;
3333
if (this.parent !== null) {
@@ -43,11 +43,11 @@ export default class Node {
4343
this.startDistance = Math.sqrt((Math.pow(this.position.x - this.destination.x, 2) + Math.pow(this.position.y - this.destination.y, 2)));;
4444
}
4545

46-
getDestinationAngle = function () {
46+
getDestinationAngle() {
4747
return Math.atan2((this.destination.y - this.position.y), (this.destination.x - this.position.x));
4848
}
4949

50-
move = function () {
50+
move() {
5151

5252
var distance = Math.sqrt((Math.pow(this.position.x - this.destination.x, 2) + Math.pow(this.position.y - this.destination.y, 2)));
5353
var percent = 100 - ((distance / this.startDistance) * 100);
@@ -74,7 +74,7 @@ export default class Node {
7474
this.position.add(velocity);
7575
};
7676

77-
addChild = function (childNode) {
77+
addChild(childNode) {
7878
childNode.level = this.level + 1;
7979
childNode.parent = this;
8080
childNode.setPosition();
@@ -83,15 +83,15 @@ export default class Node {
8383
this.children.push(childNode);
8484
return childNode;
8585
}
86-
reachedTarget = function () {
86+
reachedTarget() {
8787
var distance = Math.sqrt((Math.pow(this.position.x - this.destination.x, 2) + Math.pow(this.position.y - this.destination.y, 2)));
8888
if (this.level === 0) {
8989
return distance < 10;
9090
}
9191
return distance < 20;
9292
}
9393

94-
update = function () {
94+
update() {
9595
if (this.reachedTarget()) {
9696
if (this.wait) {
9797
this.waitTime++;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "particle-animation",
3-
"version": "1.0.5",
3+
"version": "1.0.7",
44
"description": "Add a soothing animation to your web site to add life!",
55
"main": "index.js",
66
"keywords": [

0 commit comments

Comments
 (0)