Skip to content

Commit 2da6a2b

Browse files
committed
Update JSDoc on "Impact" physics
1 parent af3c03a commit 2da6a2b

18 files changed

Lines changed: 103 additions & 104 deletions

src/physics/impact/Body.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ var Body = new Class({
293293
* @since 3.0.0
294294
*/
295295
this.updateCallback;
296-
296+
297297
/**
298298
* min 44 deg, max 136 deg
299299
*
@@ -331,7 +331,7 @@ var Body = new Class({
331331
this.accelGround = 0;
332332
this.accelAir = 0;
333333
this.jumpSpeed = 0;
334-
334+
335335
this.type = TYPE.NONE;
336336
this.checkAgainst = TYPE.NONE;
337337
this.collides = COLLIDES.NEVER;
@@ -353,10 +353,10 @@ var Body = new Class({
353353
this.last.y = pos.y;
354354

355355
this.vel.y += this.world.gravity * delta * this.gravityFactor;
356-
356+
357357
this.vel.x = GetVelocity(delta, this.vel.x, this.accel.x, this.friction.x, this.maxVel.x);
358358
this.vel.y = GetVelocity(delta, this.vel.y, this.accel.y, this.friction.y, this.maxVel.y);
359-
359+
360360
var mx = this.vel.x * delta;
361361
var my = this.vel.y * delta;
362362

@@ -539,7 +539,7 @@ var Body = new Class({
539539
* @since 3.0.0
540540
*
541541
* @param {Phaser.Physics.Impact.Body} other - [description]
542-
* @param {[type]} axis - [description]
542+
* @param {string} axis - [description]
543543
*/
544544
collideWith: function (other, axis)
545545
{

src/physics/impact/COLLIDES.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,20 @@
66

77
/**
88
* Collision Types - Determine if and how entities collide with each other.
9-
*
9+
*
1010
* In ACTIVE vs. LITE or FIXED vs. ANY collisions, only the "weak" entity moves,
1111
* while the other one stays fixed. In ACTIVE vs. ACTIVE and ACTIVE vs. PASSIVE
1212
* collisions, both entities are moved. LITE or PASSIVE entities don't collide
1313
* with other LITE or PASSIVE entities at all. The behavior for FIXED vs.
1414
* FIXED collisions is undefined.
15-
*
15+
*
1616
* @namespace Phaser.Physics.Impact.COLLIDES
1717
*/
18-
1918
module.exports = {
2019

2120
/**
2221
* Never collides.
23-
*
22+
*
2423
* @name Phaser.Physics.Impact.COLLIDES.NEVER
2524
* @type {integer}
2625
* @since 3.0.0
@@ -29,7 +28,7 @@ module.exports = {
2928

3029
/**
3130
* Lite collision.
32-
*
31+
*
3332
* @name Phaser.Physics.Impact.COLLIDES.LITE
3433
* @type {integer}
3534
* @since 3.0.0
@@ -38,7 +37,7 @@ module.exports = {
3837

3938
/**
4039
* Passive collision.
41-
*
40+
*
4241
* @name Phaser.Physics.Impact.COLLIDES.PASSIVE
4342
* @type {integer}
4443
* @since 3.0.0
@@ -47,7 +46,7 @@ module.exports = {
4746

4847
/**
4948
* Active collision.
50-
*
49+
*
5150
* @name Phaser.Physics.Impact.COLLIDES.ACTIVE
5251
* @type {integer}
5352
* @since 3.0.0
@@ -56,7 +55,7 @@ module.exports = {
5655

5756
/**
5857
* Fixed collision.
59-
*
58+
*
6059
* @name Phaser.Physics.Impact.COLLIDES.FIXED
6160
* @type {integer}
6261
* @since 3.0.0

src/physics/impact/Factory.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ var Factory = new Class({
9797
*
9898
* @param {number} x - The horizontal position of this Game Object in the world.
9999
* @param {number} y - The vertical position of this Game Object in the world.
100-
* @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
100+
* @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
101101
* @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with.
102102
*
103103
* @return {Phaser.Physics.Impact.ImpactImage} The ImpactImage object that was created.
@@ -119,7 +119,7 @@ var Factory = new Class({
119119
*
120120
* @param {number} x - The horizontal position of this Game Object in the world.
121121
* @param {number} y - The vertical position of this Game Object in the world.
122-
* @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
122+
* @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
123123
* @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with.
124124
*
125125
* @return {Phaser.Physics.Impact.ImpactSprite} The ImpactSprite object that was created.

src/physics/impact/TYPE.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,20 @@
66

77
/**
88
* Collision Types - Determine if and how entities collide with each other.
9-
*
9+
*
1010
* In ACTIVE vs. LITE or FIXED vs. ANY collisions, only the "weak" entity moves,
1111
* while the other one stays fixed. In ACTIVE vs. ACTIVE and ACTIVE vs. PASSIVE
1212
* collisions, both entities are moved. LITE or PASSIVE entities don't collide
1313
* with other LITE or PASSIVE entities at all. The behavior for FIXED vs.
1414
* FIXED collisions is undefined.
15-
*
15+
*
1616
* @namespace Phaser.Physics.Impact.TYPES
1717
*/
18-
1918
module.exports = {
2019

2120
/**
2221
* Collides with nothing.
23-
*
22+
*
2423
* @name Phaser.Physics.Impact.TYPES.NONE
2524
* @type {integer}
2625
* @since 3.0.0
@@ -29,7 +28,7 @@ module.exports = {
2928

3029
/**
3130
* Type A. Collides with Type B.
32-
*
31+
*
3332
* @name Phaser.Physics.Impact.TYPES.A
3433
* @type {integer}
3534
* @since 3.0.0
@@ -38,7 +37,7 @@ module.exports = {
3837

3938
/**
4039
* Type B. Collides with Type A.
41-
*
40+
*
4241
* @name Phaser.Physics.Impact.TYPES.B
4342
* @type {integer}
4443
* @since 3.0.0
@@ -47,7 +46,7 @@ module.exports = {
4746

4847
/**
4948
* Collides with both types A and B.
50-
*
49+
*
5150
* @name Phaser.Physics.Impact.TYPES.BOTH
5251
* @type {integer}
5352
* @since 3.0.0

src/physics/impact/components/Acceleration.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ var Acceleration = {
1818
* @method Phaser.Physics.Impact.Components.Acceleration#setAccelerationX
1919
* @since 3.0.0
2020
*
21-
* @param {[type]} x - [description]
21+
* @param {number} x - [description]
2222
*
23-
* @return {[type]} [description]
23+
* @return {Phaser.GameObjects.GameObject} This Game Object.
2424
*/
2525
setAccelerationX: function (x)
2626
{
@@ -35,9 +35,9 @@ var Acceleration = {
3535
* @method Phaser.Physics.Impact.Components.Acceleration#setAccelerationY
3636
* @since 3.0.0
3737
*
38-
* @param {[type]} y - [description]
38+
* @param {number} y - [description]
3939
*
40-
* @return {[type]} [description]
40+
* @return {Phaser.GameObjects.GameObject} This Game Object.
4141
*/
4242
setAccelerationY: function (y)
4343
{
@@ -52,10 +52,10 @@ var Acceleration = {
5252
* @method Phaser.Physics.Impact.Components.Acceleration#setAcceleration
5353
* @since 3.0.0
5454
*
55-
* @param {[type]} x - [description]
56-
* @param {[type]} y - [description]
55+
* @param {number} x - [description]
56+
* @param {number} y - [description]
5757
*
58-
* @return {[type]} [description]
58+
* @return {Phaser.GameObjects.GameObject} This Game Object.
5959
*/
6060
setAcceleration: function (x, y)
6161
{

src/physics/impact/components/BodyScale.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ var BodyScale = {
1818
* @method Phaser.Physics.Impact.Components.BodyScale#setBodySize
1919
* @since 3.0.0
2020
*
21-
* @param {[type]} width - [description]
22-
* @param {[type]} height - [description]
21+
* @param {number} width - [description]
22+
* @param {number} [height=width] - [description]
2323
*
24-
* @return {[type]} [description]
24+
* @return {Phaser.GameObjects.GameObject} This Game Object.
2525
*/
2626
setBodySize: function (width, height)
2727
{
@@ -39,10 +39,10 @@ var BodyScale = {
3939
* @method Phaser.Physics.Impact.Components.BodyScale#setBodyScale
4040
* @since 3.0.0
4141
*
42-
* @param {[type]} scaleX - [description]
43-
* @param {[type]} scaleY - [description]
42+
* @param {number} scaleX - [description]
43+
* @param {number} [scaleY] - [description]
4444
*
45-
* @return {[type]} [description]
45+
* @return {Phaser.GameObjects.GameObject} This Game Object.
4646
*/
4747
setBodyScale: function (scaleX, scaleY)
4848
{

src/physics/impact/components/BodyType.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var BodyType = {
2020
* @method Phaser.Physics.Impact.Components.BodyType#getBodyType
2121
* @since 3.0.0
2222
*
23-
* @return {[type]} [description]
23+
* @return {number} [description]
2424
*/
2525
getBodyType: function ()
2626
{
@@ -33,7 +33,7 @@ var BodyType = {
3333
* @method Phaser.Physics.Impact.Components.BodyType#setTypeNone
3434
* @since 3.0.0
3535
*
36-
* @return {[type]} [description]
36+
* @return {Phaser.GameObjects.GameObject} This Game Object.
3737
*/
3838
setTypeNone: function ()
3939
{
@@ -48,7 +48,7 @@ var BodyType = {
4848
* @method Phaser.Physics.Impact.Components.BodyType#setTypeA
4949
* @since 3.0.0
5050
*
51-
* @return {[type]} [description]
51+
* @return {Phaser.GameObjects.GameObject} This Game Object.
5252
*/
5353
setTypeA: function ()
5454
{
@@ -63,7 +63,7 @@ var BodyType = {
6363
* @method Phaser.Physics.Impact.Components.BodyType#setTypeB
6464
* @since 3.0.0
6565
*
66-
* @return {[type]} [description]
66+
* @return {Phaser.GameObjects.GameObject} This Game Object.
6767
*/
6868
setTypeB: function ()
6969
{

src/physics/impact/components/Bounce.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ var Bounce = {
1818
* @method Phaser.Physics.Impact.Components.Bounce#setBounce
1919
* @since 3.0.0
2020
*
21-
* @param {[type]} value - [description]
21+
* @param {number} value - [description]
2222
*
23-
* @return {[type]} [description]
23+
* @return {Phaser.GameObjects.GameObject} This Game Object.
2424
*/
2525
setBounce: function (value)
2626
{
@@ -35,9 +35,9 @@ var Bounce = {
3535
* @method Phaser.Physics.Impact.Components.Bounce#setMinBounceVelocity
3636
* @since 3.0.0
3737
*
38-
* @param {[type]} value - [description]
38+
* @param {number} value - [description]
3939
*
40-
* @return {[type]} [description]
40+
* @return {Phaser.GameObjects.GameObject} This Game Object.
4141
*/
4242
setMinBounceVelocity: function (value)
4343
{
@@ -50,7 +50,7 @@ var Bounce = {
5050
* [description]
5151
*
5252
* @name Phaser.Physics.Impact.Components.Bounce#bounce
53-
* @type {[type]}
53+
* @type {number}
5454
* @since 3.0.0
5555
*/
5656
bounce: {

src/physics/impact/components/CheckAgainst.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var CheckAgainst = {
2020
* @method Phaser.Physics.Impact.Components.CheckAgainst#setAvsB
2121
* @since 3.0.0
2222
*
23-
* @return {[type]} [description]
23+
* @return {Phaser.GameObjects.GameObject} This Game Object.
2424
*/
2525
setAvsB: function ()
2626
{
@@ -35,7 +35,7 @@ var CheckAgainst = {
3535
* @method Phaser.Physics.Impact.Components.CheckAgainst#setBvsA
3636
* @since 3.0.0
3737
*
38-
* @return {[type]} [description]
38+
* @return {Phaser.GameObjects.GameObject} This Game Object.
3939
*/
4040
setBvsA: function ()
4141
{
@@ -50,7 +50,7 @@ var CheckAgainst = {
5050
* @method Phaser.Physics.Impact.Components.CheckAgainst#setCheckAgainstNone
5151
* @since 3.0.0
5252
*
53-
* @return {[type]} [description]
53+
* @return {Phaser.GameObjects.GameObject} This Game Object.
5454
*/
5555
setCheckAgainstNone: function ()
5656
{
@@ -65,7 +65,7 @@ var CheckAgainst = {
6565
* @method Phaser.Physics.Impact.Components.CheckAgainst#setCheckAgainstA
6666
* @since 3.0.0
6767
*
68-
* @return {[type]} [description]
68+
* @return {Phaser.GameObjects.GameObject} This Game Object.
6969
*/
7070
setCheckAgainstA: function ()
7171
{
@@ -80,7 +80,7 @@ var CheckAgainst = {
8080
* @method Phaser.Physics.Impact.Components.CheckAgainst#setCheckAgainstB
8181
* @since 3.0.0
8282
*
83-
* @return {[type]} [description]
83+
* @return {Phaser.GameObjects.GameObject} This Game Object.
8484
*/
8585
setCheckAgainstB: function ()
8686
{
@@ -93,7 +93,7 @@ var CheckAgainst = {
9393
* [description]
9494
*
9595
* @name Phaser.Physics.Impact.Components.CheckAgainst#checkAgainst
96-
* @type {[type]}
96+
* @type {number}
9797
* @since 3.0.0
9898
*/
9999
checkAgainst: {

0 commit comments

Comments
 (0)