Skip to content

Commit 5db0580

Browse files
committed
Added jsdocs.
1 parent a71998d commit 5db0580

9 files changed

Lines changed: 487 additions & 44 deletions

File tree

src/physics/impact/Body.js

Lines changed: 355 additions & 12 deletions
Large diffs are not rendered by default.

src/physics/impact/COLLIDES.js

Lines changed: 50 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,60 @@
1-
// Collision Types - Determine if and how entities collide with each other
2-
3-
// In ACTIVE vs. LITE or FIXED vs. ANY collisions, only the "weak" entity moves,
4-
// while the other one stays fixed. In ACTIVE vs. ACTIVE and ACTIVE vs. PASSIVE
5-
// collisions, both entities are moved. LITE or PASSIVE entities don't collide
6-
// with other LITE or PASSIVE entities at all. The behaiviour for FIXED vs.
7-
// FIXED collisions is undefined.
1+
/**
2+
* Collision Types - Determine if and how entities collide with each other.
3+
*
4+
* In ACTIVE vs. LITE or FIXED vs. ANY collisions, only the "weak" entity moves,
5+
* while the other one stays fixed. In ACTIVE vs. ACTIVE and ACTIVE vs. PASSIVE
6+
* collisions, both entities are moved. LITE or PASSIVE entities don't collide
7+
* with other LITE or PASSIVE entities at all. The behavior for FIXED vs.
8+
* FIXED collisions is undefined.
9+
*
10+
* @namespace Phaser.Physics.Impact.COLLIDES
11+
*/
812

913
module.exports = {
1014

15+
/**
16+
* Never collides.
17+
*
18+
* @name Phaser.Physics.Impact.COLLIDES.NEVER
19+
* @type {integer}
20+
* @since 3.0.0
21+
*/
1122
NEVER: 0,
23+
24+
/**
25+
* Lite collision.
26+
*
27+
* @name Phaser.Physics.Impact.COLLIDES.LITE
28+
* @type {integer}
29+
* @since 3.0.0
30+
*/
1231
LITE: 1,
32+
33+
/**
34+
* Passive collision.
35+
*
36+
* @name Phaser.Physics.Impact.COLLIDES.PASSIVE
37+
* @type {integer}
38+
* @since 3.0.0
39+
*/
1340
PASSIVE: 2,
41+
42+
/**
43+
* Active collision.
44+
*
45+
* @name Phaser.Physics.Impact.COLLIDES.ACTIVE
46+
* @type {integer}
47+
* @since 3.0.0
48+
*/
1449
ACTIVE: 4,
50+
51+
/**
52+
* Fixed collision.
53+
*
54+
* @name Phaser.Physics.Impact.COLLIDES.FIXED
55+
* @type {integer}
56+
* @since 3.0.0
57+
*/
1558
FIXED: 8
1659

1760
};

src/physics/impact/SeperateX.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
1+
/**
2+
* [description]
3+
*
4+
* @function Phaser.Physics.Impact.SeperateX
5+
* @since 3.0.0
6+
*
7+
* @param {Phaser.Physics.Impact.World} world - [description]
8+
* @param {Phaser.Physics.Impact.Body} left - [description]
9+
* @param {Phaser.Physics.Impact.Body} right - [description]
10+
* @param {Phaser.Physics.Impact.Body} [weak] - [description]
11+
*/
212
var SeperateX = function (world, left, right, weak)
313
{
414
var nudge = left.pos.x + left.size.x - right.pos.x;

src/physics/impact/SeperateY.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
1+
/**
2+
* [description]
3+
*
4+
* @function Phaser.Physics.Impact.SeperateY
5+
* @since 3.0.0
6+
*
7+
* @param {Phaser.Physics.Impact.World} world - [description]
8+
* @param {Phaser.Physics.Impact.Body} top - [description]
9+
* @param {Phaser.Physics.Impact.Body} bottom - [description]
10+
* @param {Phaser.Physics.Impact.Body} [weak] - [description]
11+
*/
212
var SeperateY = function (world, top, bottom, weak)
313
{
414
var nudge = (top.pos.y + top.size.y - bottom.pos.y);

src/physics/impact/TYPE.js

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,51 @@
1-
// Collision Types - Determine if and how entities collide with each other
2-
3-
// In ACTIVE vs. LITE or FIXED vs. ANY collisions, only the "weak" entity moves,
4-
// while the other one stays fixed. In ACTIVE vs. ACTIVE and ACTIVE vs. PASSIVE
5-
// collisions, both entities are moved. LITE or PASSIVE entities don't collide
6-
// with other LITE or PASSIVE entities at all. The behavior for FIXED vs.
7-
// FIXED collisions is undefined.
1+
/**
2+
* Collision Types - Determine if and how entities collide with each other.
3+
*
4+
* In ACTIVE vs. LITE or FIXED vs. ANY collisions, only the "weak" entity moves,
5+
* while the other one stays fixed. In ACTIVE vs. ACTIVE and ACTIVE vs. PASSIVE
6+
* collisions, both entities are moved. LITE or PASSIVE entities don't collide
7+
* with other LITE or PASSIVE entities at all. The behavior for FIXED vs.
8+
* FIXED collisions is undefined.
9+
*
10+
* @namespace Phaser.Physics.Impact.TYPES
11+
*/
812

913
module.exports = {
1014

15+
/**
16+
* Collides with nothing.
17+
*
18+
* @name Phaser.Physics.Impact.TYPES.NONE
19+
* @type {integer}
20+
* @since 3.0.0
21+
*/
1122
NONE: 0,
23+
24+
/**
25+
* Type A. Collides with Type B.
26+
*
27+
* @name Phaser.Physics.Impact.TYPES.A
28+
* @type {integer}
29+
* @since 3.0.0
30+
*/
1231
A: 1,
32+
33+
/**
34+
* Type B. Collides with Type A.
35+
*
36+
* @name Phaser.Physics.Impact.TYPES.B
37+
* @type {integer}
38+
* @since 3.0.0
39+
*/
1340
B: 2,
41+
42+
/**
43+
* Collides with both types A and B.
44+
*
45+
* @name Phaser.Physics.Impact.TYPES.BOTH
46+
* @type {integer}
47+
* @since 3.0.0
48+
*/
1449
BOTH: 3
1550

1651
};

src/physics/impact/index.js

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
1-
// Phaser.Physics.Impact
2-
3-
// An Impact.js compatible physics world, body and solver, for those who are used
4-
// to the Impact way of defining and controlling physics bodies. Also works with
5-
// the new Loader support for Weltmeister map data.
6-
//
7-
// World updated to run off the Phaser main loop.
8-
// Body extended to support additional setter functions.
9-
//
10-
// To create the map data you'll need Weltmeister, which comes with Impact
11-
// and can be purchased from http://impactjs.com
12-
//
13-
// My thanks to Dominic Szablewski for his permission to support Impact in Phaser.
1+
/**
2+
* An Impact.js compatible physics world, body and solver, for those who are used
3+
* to the Impact way of defining and controlling physics bodies. Also works with
4+
* the new Loader support for Weltmeister map data.
5+
*
6+
* World updated to run off the Phaser main loop.
7+
* Body extended to support additional setter functions.
8+
*
9+
* To create the map data you'll need Weltmeister, which comes with Impact
10+
* and can be purchased from http://impactjs.com
11+
*
12+
* My thanks to Dominic Szablewski for his permission to support Impact in Phaser.
13+
*
14+
* @namespace Phaser.Physics.Impact
15+
*/
1416

1517
module.exports = {
1618

1719
Body: require('./Body'),
18-
Body: require('./ImpactBody'),
1920
COLLIDES: require('./COLLIDES'),
2021
CollisionMap: require('./CollisionMap'),
2122
Factory: require('./Factory'),
2223
Image: require('./ImpactImage'),
24+
ImpactBody: require('./ImpactBody'),
2325
ImpactPhysics: require('./ImpactPhysics'),
2426
Sprite: require('./ImpactSprite'),
2527
TYPE: require('./TYPE'),

src/physics/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ module.exports = {
66

77
Arcade: require('./arcade'),
88
Impact: require('./impact'),
9-
Matter: require('./matter-js'),
10-
PolyDecomp: require('./poly-decomp')
9+
Matter: require('./matter-js')
1110

1211
};

src/physics/matter-js/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ module.exports = {
66
Image: require('./MatterImage'),
77
Matter: require('./CustomMain'),
88
MatterPhysics: require('./MatterPhysics'),
9+
PolyDecomp: require('./poly-decomp'),
910
Sprite: require('./MatterSprite'),
1011
TileBody: require('./MatterTileBody'),
1112
World: require('./World')
File renamed without changes.

0 commit comments

Comments
 (0)