Skip to content

Commit 18c00ab

Browse files
committed
Added Friction component
1 parent ad5fc69 commit 18c00ab

5 files changed

Lines changed: 31 additions & 0 deletions

File tree

v3/src/physics/impact/ImpactBody.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ var ImpactBody = new Class({
1111
Components.CheckAgainst,
1212
Components.Collides,
1313
Components.Debug,
14+
Components.Friction,
1415
Components.Gravity,
1516
Components.Offset,
1617
Components.SetGameObject,

v3/src/physics/impact/ImpactImage.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ var ImpactImage = new Class({
1414
Components.CheckAgainst,
1515
Components.Collides,
1616
Components.Debug,
17+
Components.Friction,
1718
Components.Gravity,
1819
Components.Offset,
1920
Components.SetGameObject,

v3/src/physics/impact/ImpactSprite.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ var ImpactSprite = new Class({
1414
Components.CheckAgainst,
1515
Components.Collides,
1616
Components.Debug,
17+
Components.Friction,
1718
Components.Gravity,
1819
Components.Offset,
1920
Components.SetGameObject,
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
var Friction = {
2+
3+
setFrictionX: function (x)
4+
{
5+
this.friction.x = x;
6+
7+
return this;
8+
},
9+
10+
setFrictionY: function (y)
11+
{
12+
this.friction.y = y;
13+
14+
return this;
15+
},
16+
17+
setFriction: function (x, y)
18+
{
19+
this.friction.x = x;
20+
this.friction.y = y;
21+
22+
return this;
23+
}
24+
25+
};
26+
27+
module.exports = Friction;

v3/src/physics/impact/components/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module.exports = {
88
CheckAgainst: require('./CheckAgainst'),
99
Collides: require('./Collides'),
1010
Debug: require('./Debug'),
11+
Friction: require('./Friction'),
1112
Gravity: require('./Gravity'),
1213
Offset: require('./Offset'),
1314
SetGameObject: require('./SetGameObject'),

0 commit comments

Comments
 (0)