Update JSDoc on "Impact" physics

This commit is contained in:
orblazer 2018-03-19 00:42:09 +01:00
parent af3c03a3cb
commit 2da6a2bffe
18 changed files with 103 additions and 104 deletions

View file

@ -293,7 +293,7 @@ var Body = new Class({
* @since 3.0.0
*/
this.updateCallback;
/**
* min 44 deg, max 136 deg
*
@ -331,7 +331,7 @@ var Body = new Class({
this.accelGround = 0;
this.accelAir = 0;
this.jumpSpeed = 0;
this.type = TYPE.NONE;
this.checkAgainst = TYPE.NONE;
this.collides = COLLIDES.NEVER;
@ -353,10 +353,10 @@ var Body = new Class({
this.last.y = pos.y;
this.vel.y += this.world.gravity * delta * this.gravityFactor;
this.vel.x = GetVelocity(delta, this.vel.x, this.accel.x, this.friction.x, this.maxVel.x);
this.vel.y = GetVelocity(delta, this.vel.y, this.accel.y, this.friction.y, this.maxVel.y);
var mx = this.vel.x * delta;
var my = this.vel.y * delta;
@ -539,7 +539,7 @@ var Body = new Class({
* @since 3.0.0
*
* @param {Phaser.Physics.Impact.Body} other - [description]
* @param {[type]} axis - [description]
* @param {string} axis - [description]
*/
collideWith: function (other, axis)
{

View file

@ -6,21 +6,20 @@
/**
* Collision Types - Determine if and how entities collide with each other.
*
*
* In ACTIVE vs. LITE or FIXED vs. ANY collisions, only the "weak" entity moves,
* while the other one stays fixed. In ACTIVE vs. ACTIVE and ACTIVE vs. PASSIVE
* collisions, both entities are moved. LITE or PASSIVE entities don't collide
* with other LITE or PASSIVE entities at all. The behavior for FIXED vs.
* FIXED collisions is undefined.
*
*
* @namespace Phaser.Physics.Impact.COLLIDES
*/
module.exports = {
/**
* Never collides.
*
*
* @name Phaser.Physics.Impact.COLLIDES.NEVER
* @type {integer}
* @since 3.0.0
@ -29,7 +28,7 @@ module.exports = {
/**
* Lite collision.
*
*
* @name Phaser.Physics.Impact.COLLIDES.LITE
* @type {integer}
* @since 3.0.0
@ -38,7 +37,7 @@ module.exports = {
/**
* Passive collision.
*
*
* @name Phaser.Physics.Impact.COLLIDES.PASSIVE
* @type {integer}
* @since 3.0.0
@ -47,7 +46,7 @@ module.exports = {
/**
* Active collision.
*
*
* @name Phaser.Physics.Impact.COLLIDES.ACTIVE
* @type {integer}
* @since 3.0.0
@ -56,7 +55,7 @@ module.exports = {
/**
* Fixed collision.
*
*
* @name Phaser.Physics.Impact.COLLIDES.FIXED
* @type {integer}
* @since 3.0.0

View file

@ -97,7 +97,7 @@ var Factory = new Class({
*
* @param {number} x - The horizontal position of this Game Object in the world.
* @param {number} y - The vertical position of this Game Object in the world.
* @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
* @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
* @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with.
*
* @return {Phaser.Physics.Impact.ImpactImage} The ImpactImage object that was created.
@ -119,7 +119,7 @@ var Factory = new Class({
*
* @param {number} x - The horizontal position of this Game Object in the world.
* @param {number} y - The vertical position of this Game Object in the world.
* @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
* @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
* @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with.
*
* @return {Phaser.Physics.Impact.ImpactSprite} The ImpactSprite object that was created.

View file

@ -6,21 +6,20 @@
/**
* Collision Types - Determine if and how entities collide with each other.
*
*
* In ACTIVE vs. LITE or FIXED vs. ANY collisions, only the "weak" entity moves,
* while the other one stays fixed. In ACTIVE vs. ACTIVE and ACTIVE vs. PASSIVE
* collisions, both entities are moved. LITE or PASSIVE entities don't collide
* with other LITE or PASSIVE entities at all. The behavior for FIXED vs.
* FIXED collisions is undefined.
*
*
* @namespace Phaser.Physics.Impact.TYPES
*/
module.exports = {
/**
* Collides with nothing.
*
*
* @name Phaser.Physics.Impact.TYPES.NONE
* @type {integer}
* @since 3.0.0
@ -29,7 +28,7 @@ module.exports = {
/**
* Type A. Collides with Type B.
*
*
* @name Phaser.Physics.Impact.TYPES.A
* @type {integer}
* @since 3.0.0
@ -38,7 +37,7 @@ module.exports = {
/**
* Type B. Collides with Type A.
*
*
* @name Phaser.Physics.Impact.TYPES.B
* @type {integer}
* @since 3.0.0
@ -47,7 +46,7 @@ module.exports = {
/**
* Collides with both types A and B.
*
*
* @name Phaser.Physics.Impact.TYPES.BOTH
* @type {integer}
* @since 3.0.0

View file

@ -18,9 +18,9 @@ var Acceleration = {
* @method Phaser.Physics.Impact.Components.Acceleration#setAccelerationX
* @since 3.0.0
*
* @param {[type]} x - [description]
* @param {number} x - [description]
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setAccelerationX: function (x)
{
@ -35,9 +35,9 @@ var Acceleration = {
* @method Phaser.Physics.Impact.Components.Acceleration#setAccelerationY
* @since 3.0.0
*
* @param {[type]} y - [description]
* @param {number} y - [description]
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setAccelerationY: function (y)
{
@ -52,10 +52,10 @@ var Acceleration = {
* @method Phaser.Physics.Impact.Components.Acceleration#setAcceleration
* @since 3.0.0
*
* @param {[type]} x - [description]
* @param {[type]} y - [description]
* @param {number} x - [description]
* @param {number} y - [description]
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setAcceleration: function (x, y)
{

View file

@ -18,10 +18,10 @@ var BodyScale = {
* @method Phaser.Physics.Impact.Components.BodyScale#setBodySize
* @since 3.0.0
*
* @param {[type]} width - [description]
* @param {[type]} height - [description]
* @param {number} width - [description]
* @param {number} [height=width] - [description]
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setBodySize: function (width, height)
{
@ -39,10 +39,10 @@ var BodyScale = {
* @method Phaser.Physics.Impact.Components.BodyScale#setBodyScale
* @since 3.0.0
*
* @param {[type]} scaleX - [description]
* @param {[type]} scaleY - [description]
* @param {number} scaleX - [description]
* @param {number} [scaleY] - [description]
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setBodyScale: function (scaleX, scaleY)
{

View file

@ -20,7 +20,7 @@ var BodyType = {
* @method Phaser.Physics.Impact.Components.BodyType#getBodyType
* @since 3.0.0
*
* @return {[type]} [description]
* @return {number} [description]
*/
getBodyType: function ()
{
@ -33,7 +33,7 @@ var BodyType = {
* @method Phaser.Physics.Impact.Components.BodyType#setTypeNone
* @since 3.0.0
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setTypeNone: function ()
{
@ -48,7 +48,7 @@ var BodyType = {
* @method Phaser.Physics.Impact.Components.BodyType#setTypeA
* @since 3.0.0
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setTypeA: function ()
{
@ -63,7 +63,7 @@ var BodyType = {
* @method Phaser.Physics.Impact.Components.BodyType#setTypeB
* @since 3.0.0
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setTypeB: function ()
{

View file

@ -18,9 +18,9 @@ var Bounce = {
* @method Phaser.Physics.Impact.Components.Bounce#setBounce
* @since 3.0.0
*
* @param {[type]} value - [description]
* @param {number} value - [description]
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setBounce: function (value)
{
@ -35,9 +35,9 @@ var Bounce = {
* @method Phaser.Physics.Impact.Components.Bounce#setMinBounceVelocity
* @since 3.0.0
*
* @param {[type]} value - [description]
* @param {number} value - [description]
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setMinBounceVelocity: function (value)
{
@ -50,7 +50,7 @@ var Bounce = {
* [description]
*
* @name Phaser.Physics.Impact.Components.Bounce#bounce
* @type {[type]}
* @type {number}
* @since 3.0.0
*/
bounce: {

View file

@ -20,7 +20,7 @@ var CheckAgainst = {
* @method Phaser.Physics.Impact.Components.CheckAgainst#setAvsB
* @since 3.0.0
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setAvsB: function ()
{
@ -35,7 +35,7 @@ var CheckAgainst = {
* @method Phaser.Physics.Impact.Components.CheckAgainst#setBvsA
* @since 3.0.0
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setBvsA: function ()
{
@ -50,7 +50,7 @@ var CheckAgainst = {
* @method Phaser.Physics.Impact.Components.CheckAgainst#setCheckAgainstNone
* @since 3.0.0
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setCheckAgainstNone: function ()
{
@ -65,7 +65,7 @@ var CheckAgainst = {
* @method Phaser.Physics.Impact.Components.CheckAgainst#setCheckAgainstA
* @since 3.0.0
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setCheckAgainstA: function ()
{
@ -80,7 +80,7 @@ var CheckAgainst = {
* @method Phaser.Physics.Impact.Components.CheckAgainst#setCheckAgainstB
* @since 3.0.0
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setCheckAgainstB: function ()
{
@ -93,7 +93,7 @@ var CheckAgainst = {
* [description]
*
* @name Phaser.Physics.Impact.Components.CheckAgainst#checkAgainst
* @type {[type]}
* @type {number}
* @since 3.0.0
*/
checkAgainst: {

View file

@ -23,10 +23,10 @@ var Collides = {
* @method Phaser.Physics.Impact.Components.Collides#setCollideCallback
* @since 3.0.0
*
* @param {[type]} callback - [description]
* @param {[type]} scope - [description]
* @param {function} callback - [description]
* @param {object} scope - [description]
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setCollideCallback: function (callback, scope)
{
@ -46,7 +46,7 @@ var Collides = {
* @method Phaser.Physics.Impact.Components.Collides#setCollidesNever
* @since 3.0.0
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setCollidesNever: function ()
{
@ -61,7 +61,7 @@ var Collides = {
* @method Phaser.Physics.Impact.Components.Collides#setLite
* @since 3.0.0
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setLite: function ()
{
@ -76,7 +76,7 @@ var Collides = {
* @method Phaser.Physics.Impact.Components.Collides#setPassive
* @since 3.0.0
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setPassive: function ()
{
@ -91,7 +91,7 @@ var Collides = {
* @method Phaser.Physics.Impact.Components.Collides#setActive
* @since 3.0.0
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setActive: function ()
{
@ -106,7 +106,7 @@ var Collides = {
* @method Phaser.Physics.Impact.Components.Collides#setFixed
* @since 3.0.0
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setFixed: function ()
{
@ -119,7 +119,7 @@ var Collides = {
* [description]
*
* @name Phaser.Physics.Impact.Components.Collides#collides
* @type {[type]}
* @type {number}
* @since 3.0.0
*/
collides: {

View file

@ -18,11 +18,11 @@ var Debug = {
* @method Phaser.Physics.Impact.Components.Debug#setDebug
* @since 3.0.0
*
* @param {[type]} showBody - [description]
* @param {[type]} showVelocity - [description]
* @param {[type]} bodyColor - [description]
* @param {boolean} showBody - [description]
* @param {boolean} showVelocity - [description]
* @param {number} bodyColor - [description]
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setDebug: function (showBody, showVelocity, bodyColor)
{
@ -39,9 +39,9 @@ var Debug = {
* @method Phaser.Physics.Impact.Components.Debug#setDebugBodyColor
* @since 3.0.0
*
* @param {[type]} value - [description]
* @param {number} value - [description]
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setDebugBodyColor: function (value)
{
@ -54,7 +54,7 @@ var Debug = {
* [description]
*
* @name Phaser.Physics.Impact.Components.Debug#debugShowBody
* @type {[type]}
* @type {boolean}
* @since 3.0.0
*/
debugShowBody: {
@ -75,7 +75,7 @@ var Debug = {
* [description]
*
* @name Phaser.Physics.Impact.Components.Debug#debugShowVelocity
* @type {[type]}
* @type {boolean}
* @since 3.0.0
*/
debugShowVelocity: {
@ -96,7 +96,7 @@ var Debug = {
* [description]
*
* @name Phaser.Physics.Impact.Components.Debug#debugBodyColor
* @type {[type]}
* @type {number}
* @since 3.0.0
*/
debugBodyColor: {

View file

@ -18,9 +18,9 @@ var Friction = {
* @method Phaser.Physics.Impact.Components.Friction#setFrictionX
* @since 3.0.0
*
* @param {[type]} x - [description]
* @param {number} x - [description]
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setFrictionX: function (x)
{
@ -35,9 +35,9 @@ var Friction = {
* @method Phaser.Physics.Impact.Components.Friction#setFrictionY
* @since 3.0.0
*
* @param {[type]} y - [description]
* @param {number} y - [description]
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setFrictionY: function (y)
{
@ -52,10 +52,10 @@ var Friction = {
* @method Phaser.Physics.Impact.Components.Friction#setFriction
* @since 3.0.0
*
* @param {[type]} x - [description]
* @param {[type]} y - [description]
* @param {number} x - [description]
* @param {number} y - [description]
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setFriction: function (x, y)
{

View file

@ -18,9 +18,9 @@ var Gravity = {
* @method Phaser.Physics.Impact.Components.Gravity#setGravity
* @since 3.0.0
*
* @param {[type]} value - [description]
* @param {number} value - [description]
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setGravity: function (value)
{
@ -33,7 +33,7 @@ var Gravity = {
* [description]
*
* @name Phaser.Physics.Impact.Components.Gravity#gravity
* @type {[type]}
* @type {number}
* @since 3.0.0
*/
gravity: {

View file

@ -18,12 +18,12 @@ var Offset = {
* @method Phaser.Physics.Impact.Components.Offset#setOffset
* @since 3.0.0
*
* @param {[type]} x - [description]
* @param {[type]} y - [description]
* @param {[type]} width - [description]
* @param {[type]} height - [description]
* @param {number} x - [description]
* @param {number} y - [description]
* @param {number} [width] - [description]
* @param {number} [height] - [description]
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setOffset: function (x, y, width, height)
{

View file

@ -18,10 +18,10 @@ var SetGameObject = {
* @method Phaser.Physics.Impact.Components.SetGameObject#setGameObject
* @since 3.0.0
*
* @param {[type]} gameObject - [description]
* @param {[type]} sync - [description]
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
* @param {boolean} [sync=true] - [description]
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setGameObject: function (gameObject, sync)
{
@ -50,7 +50,7 @@ var SetGameObject = {
* @method Phaser.Physics.Impact.Components.SetGameObject#syncGameObject
* @since 3.0.0
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
syncGameObject: function ()
{

View file

@ -18,9 +18,9 @@ var Velocity = {
* @method Phaser.Physics.Impact.Components.Velocity#setVelocityX
* @since 3.0.0
*
* @param {[type]} x - [description]
* @param {number} x - [description]
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setVelocityX: function (x)
{
@ -35,9 +35,9 @@ var Velocity = {
* @method Phaser.Physics.Impact.Components.Velocity#setVelocityY
* @since 3.0.0
*
* @param {[type]} y - [description]
* @param {number} y - [description]
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setVelocityY: function (y)
{
@ -52,10 +52,10 @@ var Velocity = {
* @method Phaser.Physics.Impact.Components.Velocity#setVelocity
* @since 3.0.0
*
* @param {[type]} x - [description]
* @param {[type]} y - [description]
* @param {number} x - [description]
* @param {number} [y=x] - [description]
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setVelocity: function (x, y)
{
@ -73,10 +73,10 @@ var Velocity = {
* @method Phaser.Physics.Impact.Components.Velocity#setMaxVelocity
* @since 3.0.0
*
* @param {[type]} x - [description]
* @param {[type]} y - [description]
* @param {number} x - [description]
* @param {number} [y=x] - [description]
*
* @return {[type]} [description]
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setMaxVelocity: function (x, y)
{

View file

@ -4,7 +4,9 @@
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
// Phaser.Physics.Impact.Body.Components
/**
* @namespace Phaser.Physics.Impact.Body.Components
*/
module.exports = {

View file

@ -8,18 +8,17 @@
* An Impact.js compatible physics world, body and solver, for those who are used
* to the Impact way of defining and controlling physics bodies. Also works with
* the new Loader support for Weltmeister map data.
*
*
* World updated to run off the Phaser main loop.
* Body extended to support additional setter functions.
*
*
* To create the map data you'll need Weltmeister, which comes with Impact
* and can be purchased from http://impactjs.com
*
*
* My thanks to Dominic Szablewski for his permission to support Impact in Phaser.
*
*
* @namespace Phaser.Physics.Impact
*/
module.exports = {
Body: require('./Body'),
@ -32,5 +31,5 @@ module.exports = {
Sprite: require('./ImpactSprite'),
TYPE: require('./TYPE'),
World: require('./World')
};