Skip to content

Commit 1ab26ba

Browse files
committed
merge
1 parent 57d8cda commit 1ab26ba

File tree

6 files changed

+6
-8
lines changed

6 files changed

+6
-8
lines changed
File renamed without changes.

index.html renamed to physics/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
for (var i = 0; i < 10; i++) {
1919
var point = new Point({
2020
x: Math.round(world.width * Math.random()),
21-
//y: Math.round(world.height * Math.random())
22-
y: world.height*3/4,
21+
y: Math.round(world.height * Math.random()),
22+
// y: world.height*3/4,
2323
mass: 5+Math.random()*20
2424
});
2525
world.points.push(point)

js/Core.js renamed to physics/js/Core.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@
6262
this.initialize();
6363
}
6464

65-
Class.prototype.initialize = function () {}
66-
6765
return Class;
6866
};
6967
})();
File renamed without changes.

js/Point.js renamed to physics/js/Point.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ Point = Class.extend({
1919
//
2020
this.accelerateY += World.GRAVITY;
2121

22-
this.accelerateX *= .999;
23-
this.accelerateY *= .999;
22+
this.accelerateX *= .99;
23+
this.accelerateY *= .99;
2424

2525
var nextX = this.x + this.accelerateX;
2626
var nextY = this.y + this.accelerateY;

js/World.js renamed to physics/js/World.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ World = Class.extend({
4747

4848
if (point.y > this.height) {
4949
point.y = this.height;
50-
// point.accelerateY = -point.accelerateY * 1/point.massPower;
50+
point.accelerateY = -point.accelerateY * (1-point.massPower);
5151
}
5252

5353
this.ctx.beginPath();
@@ -63,4 +63,4 @@ World = Class.extend({
6363

6464
});
6565

66-
World.GRAVITY = .7;
66+
World.GRAVITY = .2;

0 commit comments

Comments
 (0)