Skip to content

Commit a474080

Browse files
committed
Docs: Phaser.Physics.Arcade.Components.Friction
1 parent d17c004 commit a474080

1 file changed

Lines changed: 21 additions & 11 deletions

File tree

src/physics/arcade/components/Friction.js

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,30 @@
55
*/
66

77
/**
8-
* Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving horizontally in the X axis. The higher than friction, the faster the body will slow down once force stops being applied to it.
8+
* Methods for setting the friction of an Arcade Physics Body.
9+
*
10+
* In Arcade Physics, friction is a special case of motion transfer from an "immovable" body to a riding body.
911
*
1012
* @namespace Phaser.Physics.Arcade.Components.Friction
1113
* @since 3.0.0
14+
*
15+
* @see Phaser.Physics.Arcade.Body#friction
1216
*/
1317
var Friction = {
1418

1519
/**
16-
* Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving.
17-
* The higher than friction, the faster the body will slow down once force stops being applied to it.
20+
* Sets the friction of this game object's physics body.
21+
* In Arcade Physics, friction is a special case of motion transfer from an "immovable" body to a riding body.
1822
*
1923
* @method Phaser.Physics.Arcade.Components.Friction#setFriction
2024
* @since 3.0.0
2125
*
22-
* @param {number} x - The amount of horizontal friction to apply.
23-
* @param {number} [y=x] - The amount of vertical friction to apply.
26+
* @param {number} x - The amount of horizontal friction to apply, [0, 1].
27+
* @param {number} [y=x] - The amount of vertical friction to apply, [0, 1].
2428
*
2529
* @return {this} This Game Object.
30+
*
31+
* @see Phaser.Physics.Arcade.Body#friction
2632
*/
2733
setFriction: function (x, y)
2834
{
@@ -32,15 +38,17 @@ var Friction = {
3238
},
3339

3440
/**
35-
* Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving horizontally in the X axis.
36-
* The higher than friction, the faster the body will slow down once force stops being applied to it.
41+
* Sets the horizontal friction of this game object's physics body.
42+
* This can move a riding body horizontally when it collides with this one on the vertical axis.
3743
*
3844
* @method Phaser.Physics.Arcade.Components.Friction#setFrictionX
3945
* @since 3.0.0
4046
*
41-
* @param {number} x - The amount of friction to apply.
47+
* @param {number} x - The amount of friction to apply, [0, 1].
4248
*
4349
* @return {this} This Game Object.
50+
*
51+
* @see Phaser.Physics.Arcade.Body#friction
4452
*/
4553
setFrictionX: function (x)
4654
{
@@ -50,15 +58,17 @@ var Friction = {
5058
},
5159

5260
/**
53-
* Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving vertically in the Y axis.
54-
* The higher than friction, the faster the body will slow down once force stops being applied to it.
61+
* Sets the vertical friction of this game object's physics body.
62+
* This can move a riding body vertically when it collides with this one on the horizontal axis.
5563
*
5664
* @method Phaser.Physics.Arcade.Components.Friction#setFrictionY
5765
* @since 3.0.0
5866
*
59-
* @param {number} x - The amount of friction to apply.
67+
* @param {number} y - The amount of friction to apply, [0, 1].
6068
*
6169
* @return {this} This Game Object.
70+
*
71+
* @see Phaser.Physics.Arcade.Body#friction
6272
*/
6373
setFrictionY: function (y)
6474
{

0 commit comments

Comments
 (0)