Skip to content

Commit c237209

Browse files
committed
Added new jsdocs
1 parent be5b325 commit c237209

24 files changed

Lines changed: 306 additions & 281 deletions

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,20 @@ snowbillr
9292
Stephen Hamilton
9393
STuFF
9494
TadejZupancic
95+
9596
ajmetal
9697
henriacle
9798
@rgk
9899
@samme
100+
Carl
101+
@16patsle
102+
Kyle
103+
Hardylr
104+
andiCR
105+
@bobonthenet
106+
Kanthi
107+
108+
99109

100110
## Version 3.13.0 - Yuuki - 20th September 2018
101111

src/physics/arcade/components/Acceleration.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
*/
66

77
/**
8-
* [description]
8+
* Provides methods used for setting the acceleration properties of an Arcade Body.
99
*
1010
* @name Phaser.Physics.Arcade.Components.Acceleration
1111
* @since 3.0.0
1212
*/
1313
var Acceleration = {
1414

1515
/**
16-
* [description]
16+
* Sets the body's horizontal and vertical acceleration. If the vertical acceleration value is not provided, the vertical acceleration is set to the same value as the horizontal acceleration.
1717
*
1818
* @method Phaser.Physics.Arcade.Components.Acceleration#setAcceleration
1919
* @since 3.0.0
@@ -31,7 +31,7 @@ var Acceleration = {
3131
},
3232

3333
/**
34-
* [description]
34+
* Sets the body's horizontal acceleration.
3535
*
3636
* @method Phaser.Physics.Arcade.Components.Acceleration#setAccelerationX
3737
* @since 3.0.0
@@ -48,7 +48,7 @@ var Acceleration = {
4848
},
4949

5050
/**
51-
* [description]
51+
* Sets the body's vertical acceleration.
5252
*
5353
* @method Phaser.Physics.Arcade.Components.Acceleration#setAccelerationY
5454
* @since 3.0.0

src/physics/arcade/components/Friction.js

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

77
/**
8-
* [description]
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.
99
*
1010
* @name Phaser.Physics.Arcade.Components.Friction
1111
* @since 3.0.0
1212
*/
1313
var Friction = {
1414

1515
/**
16-
* [description]
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.
1718
*
1819
* @method Phaser.Physics.Arcade.Components.Friction#setFriction
1920
* @since 3.0.0
2021
*
21-
* @param {number} x - [description]
22-
* @param {number} [y=x] - [description]
22+
* @param {number} x - The amount of horizontal friction to apply.
23+
* @param {number} [y=x] - The amount of vertical friction to apply.
2324
*
2425
* @return {this} This Game Object.
2526
*/
@@ -31,12 +32,13 @@ var Friction = {
3132
},
3233

3334
/**
34-
* [description]
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.
3537
*
3638
* @method Phaser.Physics.Arcade.Components.Friction#setFrictionX
3739
* @since 3.0.0
3840
*
39-
* @param {number} x - [description]
41+
* @param {number} x - The amount of friction to apply.
4042
*
4143
* @return {this} This Game Object.
4244
*/
@@ -48,12 +50,13 @@ var Friction = {
4850
},
4951

5052
/**
51-
* [description]
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.
5255
*
5356
* @method Phaser.Physics.Arcade.Components.Friction#setFrictionY
5457
* @since 3.0.0
5558
*
56-
* @param {number} y - [description]
59+
* @param {number} x - The amount of friction to apply.
5760
*
5861
* @return {this} This Game Object.
5962
*/

src/physics/arcade/components/Gravity.js

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

77
/**
8-
* [description]
8+
* Provides methods for setting the gravity properties of an Arcade Physics Game Object.
9+
* Should be applied as a mixin and not used directly.
910
*
1011
* @name Phaser.Physics.Arcade.Components.Gravity
1112
* @since 3.0.0
1213
*/
1314
var Gravity = {
1415

1516
/**
16-
* [description]
17+
* Set the X and Y values of the gravitational pull to act upon this Arcade Physics Game Object. Values can be positive or negative. Larger values result in a stronger effect.
18+
*
19+
* If only one value is provided, this value will be used for both the X and Y axis.
1720
*
1821
* @method Phaser.Physics.Arcade.Components.Gravity#setGravity
1922
* @since 3.0.0
2023
*
21-
* @param {number} x - [description]
22-
* @param {number} [y=x] - [description]
24+
* @param {number} x - The gravitational force to be applied to the X-axis.
25+
* @param {number} [y=x] - The gravitational force to be applied to the Y-axis. If this is not specified, the X value will be used.
2326
*
2427
* @return {this} This Game Object.
2528
*/
@@ -31,12 +34,12 @@ var Gravity = {
3134
},
3235

3336
/**
34-
* [description]
37+
* Set the gravitational force to be applied to the X axis. Value can be positive or negative. Larger values result in a stronger effect.
3538
*
3639
* @method Phaser.Physics.Arcade.Components.Gravity#setGravityX
3740
* @since 3.0.0
3841
*
39-
* @param {number} x - [description]
42+
* @param {number} x - The gravitational force to be applied to the X-axis.
4043
*
4144
* @return {this} This Game Object.
4245
*/
@@ -48,12 +51,12 @@ var Gravity = {
4851
},
4952

5053
/**
51-
* [description]
54+
* Set the gravitational force to be applied to the Y axis. Value can be positive or negative. Larger values result in a stronger effect.
5255
*
5356
* @method Phaser.Physics.Arcade.Components.Gravity#setGravityY
5457
* @since 3.0.0
5558
*
56-
* @param {number} y - [description]
59+
* @param {number} y - The gravitational force to be applied to the Y-axis.
5760
*
5861
* @return {this} This Game Object.
5962
*/

src/physics/arcade/components/Size.js

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,23 @@
55
*/
66

77
/**
8-
* [description]
8+
* Provides methods for setting the size of an Arcade Physics Game Object.
9+
* Should be applied as a mixin and not used directly.
910
*
1011
* @name Phaser.Physics.Arcade.Components.Size
1112
* @since 3.0.0
1213
*/
1314
var Size = {
1415

1516
/**
16-
* [description]
17+
* Sets the body offset. This allows you to adjust the difference between the center of the body
18+
* and the x and y coordinates of the parent Game Object.
1719
*
1820
* @method Phaser.Physics.Arcade.Components.Size#setOffset
1921
* @since 3.0.0
2022
*
21-
* @param {number} x - [description]
22-
* @param {number} [y=x] - [description]
23+
* @param {number} x - The amount to offset the body from the parent Game Object along the x-axis.
24+
* @param {number} [y=x] - The amount to offset the body from the parent Game Object along the y-axis. Defaults to the value given for the x-axis.
2325
*
2426
* @return {this} This Game Object.
2527
*/
@@ -31,14 +33,15 @@ var Size = {
3133
},
3234

3335
/**
34-
* [description]
36+
* Sets the size of this physics body. Setting the size does not adjust the dimensions
37+
* of the parent Game Object.
3538
*
3639
* @method Phaser.Physics.Arcade.Components.Size#setSize
3740
* @since 3.0.0
3841
*
39-
* @param {number} width - [description]
40-
* @param {number} height - [description]
41-
* @param {boolean} [center=true] - [description]
42+
* @param {number} width - The new width of the physics body, in pixels.
43+
* @param {number} height - The new height of the physics body, in pixels.
44+
* @param {boolean} [center=true] - Should the body be re-positioned so its center aligns with the parent Game Object?
4245
*
4346
* @return {this} This Game Object.
4447
*/
@@ -50,14 +53,14 @@ var Size = {
5053
},
5154

5255
/**
53-
* [description]
56+
* Sets this physics body to use a circle for collision instead of a rectangle.
5457
*
5558
* @method Phaser.Physics.Arcade.Components.Size#setCircle
5659
* @since 3.0.0
5760
*
58-
* @param {number} radius - [description]
59-
* @param {number} [offsetX] - [description]
60-
* @param {number} [offsetY] - [description]
61+
* @param {number} radius - The radius of the physics body, in pixels.
62+
* @param {number} [offsetX] - The amount to offset the body from the parent Game Object along the x-axis.
63+
* @param {number} [offsetY] - The amount to offset the body from the parent Game Object along the y-axis.
6164
*
6265
* @return {this} This Game Object.
6366
*/

src/physics/impact/Body.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -481,15 +481,15 @@ var Body = new Class({
481481
},
482482

483483
/**
484-
* [description]
484+
* Reset the size and position of the physics body.
485485
*
486486
* @method Phaser.Physics.Impact.Body#resetSize
487487
* @since 3.0.0
488488
*
489-
* @param {number} x - [description]
490-
* @param {number} y - [description]
491-
* @param {number} width - [description]
492-
* @param {number} height - [description]
489+
* @param {number} x - The x coordinate to position the body.
490+
* @param {number} y - The y coordinate to position the body.
491+
* @param {number} width - The width of the body.
492+
* @param {number} height - The height of the body.
493493
*
494494
* @return {Phaser.Physics.Impact.Body} This Body object.
495495
*/

src/physics/impact/Factory.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var ImpactSprite = require('./ImpactSprite');
1919
* @constructor
2020
* @since 3.0.0
2121
*
22-
* @param {Phaser.Physics.Impact.World} world - [description]
22+
* @param {Phaser.Physics.Impact.World} world - A reference to the Impact Physics world.
2323
*/
2424
var Factory = new Class({
2525

@@ -28,7 +28,7 @@ var Factory = new Class({
2828
function Factory (world)
2929
{
3030
/**
31-
* [description]
31+
* A reference to the Impact Physics world.
3232
*
3333
* @name Phaser.Physics.Impact.Factory#world
3434
* @type {Phaser.Physics.Impact.World}
@@ -47,15 +47,15 @@ var Factory = new Class({
4747
},
4848

4949
/**
50-
* [description]
50+
* Creates a new ImpactBody object and adds it to the physics simulation.
5151
*
5252
* @method Phaser.Physics.Impact.Factory#body
5353
* @since 3.0.0
5454
*
55-
* @param {number} x - [description]
56-
* @param {number} y - [description]
57-
* @param {number} width - [description]
58-
* @param {number} height - [description]
55+
* @param {number} x - The horizontal position of the body in the physics world.
56+
* @param {number} y - The vertical position of the body in the physics world.
57+
* @param {number} width - The width of the body.
58+
* @param {number} height - The height of the body.
5959
*
6060
* @return {Phaser.Physics.Impact.ImpactBody} The ImpactBody object that was created.
6161
*/
@@ -70,7 +70,7 @@ var Factory = new Class({
7070
* @method Phaser.Physics.Impact.Factory#existing
7171
* @since 3.0.0
7272
*
73-
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
73+
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to receive the physics body.
7474
*
7575
* @return {Phaser.GameObjects.GameObject} The Game Object.
7676
*/
@@ -90,7 +90,7 @@ var Factory = new Class({
9090
},
9191

9292
/**
93-
* [description]
93+
* Creates a new ImpactImage object and adds it to the physics world.
9494
*
9595
* @method Phaser.Physics.Impact.Factory#image
9696
* @since 3.0.0
@@ -112,7 +112,7 @@ var Factory = new Class({
112112
},
113113

114114
/**
115-
* [description]
115+
* Creates a new ImpactSprite object and adds it to the physics world.
116116
*
117117
* @method Phaser.Physics.Impact.Factory#sprite
118118
* @since 3.0.0

0 commit comments

Comments
 (0)