Skip to content

Commit 3bb73c5

Browse files
committed
Fixed Group defs and completed Arcade Physics defs
1 parent 43b4aad commit 3bb73c5

22 files changed

Lines changed: 195 additions & 206 deletions

src/core/typedefs/PhysicsConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @since 3.0.0
44
*
55
* @property {string} [default] - The default physics system. It will be started for each scene. Phaser provides 'arcade', 'impact', and 'matter'.
6-
* @property {ArcadeWorldConfig} [arcade] - Arcade Physics configuration.
6+
* @property {Phaser.Physics.Arcade.Types.ArcadeWorldConfig} [arcade] - Arcade Physics configuration.
77
* @property {ImpactWorldConfig} [impact] - Impact Physics configuration.
88
* @property {MatterWorldConfig} [matter] - Matter Physics configuration.
99
*/

src/gameobjects/group/Group.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ var Group = new Class({
107107
* The class to create new group members from.
108108
*
109109
* @name Phaser.GameObjects.Group#classType
110-
* @type {GroupClassTypeConstructor}
110+
* @type {Phaser.GameObjects.Group.Types.GroupClassTypeConstructor}
111111
* @since 3.0.0
112112
* @default Phaser.GameObjects.Sprite
113113
*/
@@ -169,7 +169,7 @@ var Group = new Class({
169169
* A function to be called when adding or creating group members.
170170
*
171171
* @name Phaser.GameObjects.Group#createCallback
172-
* @type {?GroupCallback}
172+
* @type {?Phaser.GameObjects.Group.Types.GroupCallback}
173173
* @since 3.0.0
174174
*/
175175
this.createCallback = GetFastValue(config, 'createCallback', null);
@@ -178,7 +178,7 @@ var Group = new Class({
178178
* A function to be called when removing group members.
179179
*
180180
* @name Phaser.GameObjects.Group#removeCallback
181-
* @type {?GroupCallback}
181+
* @type {?Phaser.GameObjects.Group.Types.GroupCallback}
182182
* @since 3.0.0
183183
*/
184184
this.removeCallback = GetFastValue(config, 'removeCallback', null);
@@ -187,7 +187,7 @@ var Group = new Class({
187187
* A function to be called when creating several group members at once.
188188
*
189189
* @name Phaser.GameObjects.Group#createMultipleCallback
190-
* @type {?GroupMultipleCreateCallback}
190+
* @type {?Phaser.GameObjects.Group.Types.GroupMultipleCreateCallback}
191191
* @since 3.0.0
192192
*/
193193
this.createMultipleCallback = GetFastValue(config, 'createMultipleCallback', null);
@@ -257,7 +257,7 @@ var Group = new Class({
257257
* @method Phaser.GameObjects.Group#createMultiple
258258
* @since 3.0.0
259259
*
260-
* @param {GroupCreateConfig|GroupCreateConfig[]} config - Creation settings. This can be a single configuration object or an array of such objects, which will be applied in turn.
260+
* @param {Phaser.GameObjects.Group.Types.GroupCreateConfig|Phaser.GameObjects.Group.Types.GroupCreateConfig[]} config - Creation settings. This can be a single configuration object or an array of such objects, which will be applied in turn.
261261
*
262262
* @return {any[]} The newly created Game Objects.
263263
*/
@@ -294,7 +294,7 @@ var Group = new Class({
294294
* @method Phaser.GameObjects.Group#createFromConfig
295295
* @since 3.0.0
296296
*
297-
* @param {GroupCreateConfig} options - Creation settings.
297+
* @param {Phaser.GameObjects.Group.Types.GroupCreateConfig} options - Creation settings.
298298
*
299299
* @return {any[]} The newly created Game Objects.
300300
*/
File renamed without changes.

src/actions/typedefs/GroupClassTypeConstructor.js renamed to src/gameobjects/group/typedefs/GroupClassTypeConstructor.js

File renamed without changes.

src/actions/typedefs/GroupMultipleCreateCallback.js renamed to src/gameobjects/group/typedefs/GroupMultipleCreateCallback.js

File renamed without changes.

src/physics/arcade/ArcadePhysics.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ var ArcadePhysics = new Class({
152152
* @method Phaser.Physics.Arcade.ArcadePhysics#overlap
153153
* @since 3.0.0
154154
*
155-
* @param {ArcadeColliderType} object1 - The first object or array of objects to check.
156-
* @param {ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`.
155+
* @param {Phaser.Physics.Arcade.Types.ArcadeColliderType} object1 - The first object or array of objects to check.
156+
* @param {Phaser.Physics.Arcade.Types.ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`.
157157
* @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide.
158158
* @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `collideCallback` will only be called if this callback returns `true`.
159159
* @param {*} [callbackContext] - The context in which to run the callbacks.
@@ -177,8 +177,8 @@ var ArcadePhysics = new Class({
177177
* @method Phaser.Physics.Arcade.ArcadePhysics#collide
178178
* @since 3.0.0
179179
*
180-
* @param {ArcadeColliderType} object1 - The first object or array of objects to check.
181-
* @param {ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`.
180+
* @param {Phaser.Physics.Arcade.Types.ArcadeColliderType} object1 - The first object or array of objects to check.
181+
* @param {Phaser.Physics.Arcade.Types.ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`.
182182
* @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide.
183183
* @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`.
184184
* @param {*} [callbackContext] - The context in which to run the callbacks.

src/physics/arcade/Body.js

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,6 @@ var Rectangle = require('../../geom/rectangle/Rectangle');
1313
var RectangleContains = require('../../geom/rectangle/Contains');
1414
var Vector2 = require('../../math/Vector2');
1515

16-
/**
17-
* @typedef {object} ArcadeBodyBounds
18-
*
19-
* @property {number} x - The left edge.
20-
* @property {number} y - The upper edge.
21-
* @property {number} right - The right edge.
22-
* @property {number} bottom - The lower edge.
23-
*/
24-
25-
/**
26-
* @typedef {object} ArcadeBodyCollision
27-
*
28-
* @property {boolean} none - True if the Body is not colliding.
29-
* @property {boolean} up - True if the Body is colliding on its upper edge.
30-
* @property {boolean} down - True if the Body is colliding on its lower edge.
31-
* @property {boolean} left - True if the Body is colliding on its left edge.
32-
* @property {boolean} right - True if the Body is colliding on its right edge.
33-
*/
34-
3516
/**
3617
* @classdesc
3718
* A Dynamic Arcade Body.
@@ -661,7 +642,7 @@ var Body = new Class({
661642
* You can set `checkCollision.none = true` to disable collision checks.
662643
*
663644
* @name Phaser.Physics.Arcade.Body#checkCollision
664-
* @type {ArcadeBodyCollision}
645+
* @type {Phaser.Physics.Arcade.Types.ArcadeBodyCollision}
665646
* @since 3.0.0
666647
*/
667648
this.checkCollision = { none: false, up: true, down: true, left: true, right: true };
@@ -670,7 +651,7 @@ var Body = new Class({
670651
* Whether this Body is colliding with another and in which direction.
671652
*
672653
* @name Phaser.Physics.Arcade.Body#touching
673-
* @type {ArcadeBodyCollision}
654+
* @type {Phaser.Physics.Arcade.Types.ArcadeBodyCollision}
674655
* @since 3.0.0
675656
*/
676657
this.touching = { none: true, up: false, down: false, left: false, right: false };
@@ -679,7 +660,7 @@ var Body = new Class({
679660
* Whether this Body was colliding with another during the last step, and in which direction.
680661
*
681662
* @name Phaser.Physics.Arcade.Body#wasTouching
682-
* @type {ArcadeBodyCollision}
663+
* @type {Phaser.Physics.Arcade.Types.ArcadeBodyCollision}
683664
* @since 3.0.0
684665
*/
685666
this.wasTouching = { none: true, up: false, down: false, left: false, right: false };
@@ -688,7 +669,7 @@ var Body = new Class({
688669
* Whether this Body is colliding with a tile or the world boundary.
689670
*
690671
* @name Phaser.Physics.Arcade.Body#blocked
691-
* @type {ArcadeBodyCollision}
672+
* @type {Phaser.Physics.Arcade.Types.ArcadeBodyCollision}
692673
* @since 3.0.0
693674
*/
694675
this.blocked = { none: true, up: false, down: false, left: false, right: false };
@@ -1262,9 +1243,9 @@ var Body = new Class({
12621243
* @method Phaser.Physics.Arcade.Body#getBounds
12631244
* @since 3.0.0
12641245
*
1265-
* @param {ArcadeBodyBounds} obj - An object to copy the values into.
1246+
* @param {Phaser.Physics.Arcade.Types.ArcadeBodyBounds} obj - An object to copy the values into.
12661247
*
1267-
* @return {ArcadeBodyBounds} - An object with {x, y, right, bottom}.
1248+
* @return {Phaser.Physics.Arcade.Types.ArcadeBodyBounds} - An object with {x, y, right, bottom}.
12681249
*/
12691250
getBounds: function (obj)
12701251
{

src/physics/arcade/Collider.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ var Class = require('../../utils/Class');
1818
*
1919
* @param {Phaser.Physics.Arcade.World} world - The Arcade physics World that will manage the collisions.
2020
* @param {boolean} overlapOnly - Whether to check for collisions or overlap.
21-
* @param {ArcadeColliderType} object1 - The first object to check for collision.
22-
* @param {ArcadeColliderType} object2 - The second object to check for collision.
21+
* @param {Phaser.Physics.Arcade.Types.ArcadeColliderType} object1 - The first object to check for collision.
22+
* @param {Phaser.Physics.Arcade.Types.ArcadeColliderType} object2 - The second object to check for collision.
2323
* @param {ArcadePhysicsCallback} collideCallback - The callback to invoke when the two objects collide.
2424
* @param {ArcadePhysicsCallback} processCallback - The callback to invoke when the two objects collide. Must return a boolean.
2525
* @param {any} callbackContext - The scope in which to call the callbacks.
@@ -71,7 +71,7 @@ var Collider = new Class({
7171
* The first object to check for collision.
7272
*
7373
* @name Phaser.Physics.Arcade.Collider#object1
74-
* @type {ArcadeColliderType}
74+
* @type {Phaser.Physics.Arcade.Types.ArcadeColliderType}
7575
* @since 3.0.0
7676
*/
7777
this.object1 = object1;
@@ -80,7 +80,7 @@ var Collider = new Class({
8080
* The second object to check for collision.
8181
*
8282
* @name Phaser.Physics.Arcade.Collider#object2
83-
* @type {ArcadeColliderType}
83+
* @type {Phaser.Physics.Arcade.Types.ArcadeColliderType}
8484
* @since 3.0.0
8585
*/
8686
this.object2 = object2;

src/physics/arcade/Factory.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ var Factory = new Class({
237237
* @method Phaser.Physics.Arcade.Factory#group
238238
* @since 3.0.0
239239
*
240-
* @param {(Phaser.GameObjects.GameObject[]|PhysicsGroupConfig|GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument.
241-
* @param {PhysicsGroupConfig|GroupCreateConfig} [config] - Settings for this group.
240+
* @param {(Phaser.GameObjects.GameObject[]|Phaser.Physics.Arcade.Types.PhysicsGroupConfig|Phaser.GameObjects.Group.Types.GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument.
241+
* @param {Phaser.Physics.Arcade.Types.PhysicsGroupConfig|Phaser.GameObjects.Group.Types.GroupCreateConfig} [config] - Settings for this group.
242242
*
243243
* @return {Phaser.Physics.Arcade.Group} The Group object that was created.
244244
*/

src/physics/arcade/PhysicsGroup.js

Lines changed: 4 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -11,61 +11,6 @@ var GetFastValue = require('../../utils/object/GetFastValue');
1111
var Group = require('../../gameobjects/group/Group');
1212
var IsPlainObject = require('../../utils/object/IsPlainObject');
1313

14-
/**
15-
* @typedef {object} PhysicsGroupConfig
16-
* @extends GroupConfig
17-
*
18-
* @property {boolean} [collideWorldBounds=false] - Sets {@link Phaser.Physics.Arcade.Body#collideWorldBounds}.
19-
* @property {number} [accelerationX=0] - Sets {@link Phaser.Physics.Arcade.Body#acceleration acceleration.x}.
20-
* @property {number} [accelerationY=0] - Sets {@link Phaser.Physics.Arcade.Body#acceleration acceleration.y}.
21-
* @property {boolean} [allowDrag=true] - Sets {@link Phaser.Physics.Arcade.Body#allowDrag}.
22-
* @property {boolean} [allowGravity=true] - Sets {@link Phaser.Physics.Arcade.Body#allowGravity}.
23-
* @property {boolean} [allowRotation=true] - Sets {@link Phaser.Physics.Arcade.Body#allowRotation}.
24-
* @property {number} [bounceX=0] - Sets {@link Phaser.Physics.Arcade.Body#bounce bounce.x}.
25-
* @property {number} [bounceY=0] - Sets {@link Phaser.Physics.Arcade.Body#bounce bounce.y}.
26-
* @property {number} [dragX=0] - Sets {@link Phaser.Physics.Arcade.Body#drag drag.x}.
27-
* @property {number} [dragY=0] - Sets {@link Phaser.Physics.Arcade.Body#drag drag.y}.
28-
* @property {boolean} [enable=true] - Sets {@link Phaser.Physics.Arcade.Body#enable enable}.
29-
* @property {number} [gravityX=0] - Sets {@link Phaser.Physics.Arcade.Body#gravity gravity.x}.
30-
* @property {number} [gravityY=0] - Sets {@link Phaser.Physics.Arcade.Body#gravity gravity.y}.
31-
* @property {number} [frictionX=0] - Sets {@link Phaser.Physics.Arcade.Body#friction friction.x}.
32-
* @property {number} [frictionY=0] - Sets {@link Phaser.Physics.Arcade.Body#friction friction.y}.
33-
* @property {number} [velocityX=0] - Sets {@link Phaser.Physics.Arcade.Body#velocity velocity.x}.
34-
* @property {number} [velocityY=0] - Sets {@link Phaser.Physics.Arcade.Body#velocity velocity.y}.
35-
* @property {number} [angularVelocity=0] - Sets {@link Phaser.Physics.Arcade.Body#angularVelocity}.
36-
* @property {number} [angularAcceleration=0] - Sets {@link Phaser.Physics.Arcade.Body#angularAcceleration}.
37-
* @property {number} [angularDrag=0] - Sets {@link Phaser.Physics.Arcade.Body#angularDrag}.
38-
* @property {number} [mass=0] - Sets {@link Phaser.Physics.Arcade.Body#mass}.
39-
* @property {boolean} [immovable=false] - Sets {@link Phaser.Physics.Arcade.Body#immovable}.
40-
*/
41-
42-
/**
43-
* @typedef {object} PhysicsGroupDefaults
44-
*
45-
* @property {boolean} setCollideWorldBounds - As {@link Phaser.Physics.Arcade.Body#setCollideWorldBounds}.
46-
* @property {number} setAccelerationX - As {@link Phaser.Physics.Arcade.Body#setAccelerationX}.
47-
* @property {number} setAccelerationY - As {@link Phaser.Physics.Arcade.Body#setAccelerationY}.
48-
* @property {boolean} setAllowDrag - As {@link Phaser.Physics.Arcade.Body#setAllowDrag}.
49-
* @property {boolean} setAllowGravity - As {@link Phaser.Physics.Arcade.Body#setAllowGravity}.
50-
* @property {boolean} setAllowRotation - As {@link Phaser.Physics.Arcade.Body#setAllowRotation}.
51-
* @property {number} setBounceX - As {@link Phaser.Physics.Arcade.Body#setBounceX}.
52-
* @property {number} setBounceY - As {@link Phaser.Physics.Arcade.Body#setBounceY}.
53-
* @property {number} setDragX - As {@link Phaser.Physics.Arcade.Body#setDragX}.
54-
* @property {number} setDragY - As {@link Phaser.Physics.Arcade.Body#setDragY}.
55-
* @property {boolean} setEnable - As {@link Phaser.Physics.Arcade.Body#setEnable}.
56-
* @property {number} setGravityX - As {@link Phaser.Physics.Arcade.Body#setGravityX}.
57-
* @property {number} setGravityY - As {@link Phaser.Physics.Arcade.Body#setGravityY}.
58-
* @property {number} setFrictionX - As {@link Phaser.Physics.Arcade.Body#setFrictionX}.
59-
* @property {number} setFrictionY - As {@link Phaser.Physics.Arcade.Body#setFrictionY}.
60-
* @property {number} setVelocityX - As {@link Phaser.Physics.Arcade.Body#setVelocityX}.
61-
* @property {number} setVelocityY - As {@link Phaser.Physics.Arcade.Body#setVelocityY}.
62-
* @property {number} setAngularVelocity - As {@link Phaser.Physics.Arcade.Body#setAngularVelocity}.
63-
* @property {number} setAngularAcceleration - As {@link Phaser.Physics.Arcade.Body#setAngularAcceleration}.
64-
* @property {number} setAngularDrag - As {@link Phaser.Physics.Arcade.Body#setAngularDrag}.
65-
* @property {number} setMass - As {@link Phaser.Physics.Arcade.Body#setMass}.
66-
* @property {boolean} setImmovable - As {@link Phaser.Physics.Arcade.Body#setImmovable}.
67-
*/
68-
6914
/**
7015
* @classdesc
7116
* An Arcade Physics Group object.
@@ -82,8 +27,8 @@ var IsPlainObject = require('../../utils/object/IsPlainObject');
8227
*
8328
* @param {Phaser.Physics.Arcade.World} world - The physics simulation.
8429
* @param {Phaser.Scene} scene - The scene this group belongs to.
85-
* @param {(Phaser.GameObjects.GameObject[]|PhysicsGroupConfig|GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument.
86-
* @param {PhysicsGroupConfig|GroupCreateConfig} [config] - Settings for this group.
30+
* @param {(Phaser.GameObjects.GameObject[]|Phaser.Physics.Arcade.Types.PhysicsGroupConfig|Phaser.GameObjects.Group.Types.GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument.
31+
* @param {Phaser.Physics.Arcade.Types.PhysicsGroupConfig|Phaser.GameObjects.Group.Types.GroupCreateConfig} [config] - Settings for this group.
8732
*/
8833
var PhysicsGroup = new Class({
8934

@@ -145,7 +90,7 @@ var PhysicsGroup = new Class({
14590
* This should be either `Phaser.Physics.Arcade.Image`, `Phaser.Physics.Arcade.Sprite`, or a class extending one of those.
14691
*
14792
* @name Phaser.Physics.Arcade.Group#classType
148-
* @type {GroupClassTypeConstructor}
93+
* @type {Phaser.GameObjects.Group.Types.GroupClassTypeConstructor}
14994
* @default ArcadeSprite
15095
* @since 3.0.0
15196
*/
@@ -165,7 +110,7 @@ var PhysicsGroup = new Class({
165110
* Default physics properties applied to Game Objects added to the Group or created by the Group. Derived from the `config` argument.
166111
*
167112
* @name Phaser.Physics.Arcade.Group#defaults
168-
* @type {PhysicsGroupDefaults}
113+
* @type {Phaser.Physics.Arcade.Types.PhysicsGroupDefaults}
169114
* @since 3.0.0
170115
*/
171116
this.defaults = {

0 commit comments

Comments
 (0)