fisrt commit

This commit is contained in:
2026-01-17 11:49:36 +03:00
commit b2dfe51b9f
5379 changed files with 4408602 additions and 0 deletions

View File

@ -0,0 +1,71 @@
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2020 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
/**
* The Impact Acceleration component.
* Should be applied as a mixin.
*
* @namespace Phaser.Physics.Impact.Components.Acceleration
* @since 3.0.0
*/
var Acceleration = {
/**
* Sets the horizontal acceleration of this body.
*
* @method Phaser.Physics.Impact.Components.Acceleration#setAccelerationX
* @since 3.0.0
*
* @param {number} x - The amount of acceleration to apply.
*
* @return {this} This Game Object.
*/
setAccelerationX: function (x)
{
this.accel.x = x;
return this;
},
/**
* Sets the vertical acceleration of this body.
*
* @method Phaser.Physics.Impact.Components.Acceleration#setAccelerationY
* @since 3.0.0
*
* @param {number} y - The amount of acceleration to apply.
*
* @return {this} This Game Object.
*/
setAccelerationY: function (y)
{
this.accel.y = y;
return this;
},
/**
* Sets the horizontal and vertical acceleration of this body.
*
* @method Phaser.Physics.Impact.Components.Acceleration#setAcceleration
* @since 3.0.0
*
* @param {number} x - The amount of horizontal acceleration to apply.
* @param {number} y - The amount of vertical acceleration to apply.
*
* @return {this} This Game Object.
*/
setAcceleration: function (x, y)
{
this.accel.x = x;
this.accel.y = y;
return this;
}
};
module.exports = Acceleration;

View File

@ -0,0 +1,68 @@
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2020 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
/**
* The Impact Body Scale component.
* Should be applied as a mixin.
*
* @namespace Phaser.Physics.Impact.Components.BodyScale
* @since 3.0.0
*/
var BodyScale = {
/**
* Sets the size of the physics body.
*
* @method Phaser.Physics.Impact.Components.BodyScale#setBodySize
* @since 3.0.0
*
* @param {number} width - The width of the body in pixels.
* @param {number} [height=width] - The height of the body in pixels.
*
* @return {this} This Game Object.
*/
setBodySize: function (width, height)
{
if (height === undefined) { height = width; }
this.body.size.x = Math.round(width);
this.body.size.y = Math.round(height);
return this;
},
/**
* Sets the scale of the physics body.
*
* @method Phaser.Physics.Impact.Components.BodyScale#setBodyScale
* @since 3.0.0
*
* @param {number} scaleX - The horizontal scale of the body.
* @param {number} [scaleY] - The vertical scale of the body. If not given, will use the horizontal scale value.
*
* @return {this} This Game Object.
*/
setBodyScale: function (scaleX, scaleY)
{
if (scaleY === undefined) { scaleY = scaleX; }
var gameObject = this.body.gameObject;
if (gameObject)
{
gameObject.setScale(scaleX, scaleY);
return this.setBodySize(gameObject.width * gameObject.scaleX, gameObject.height * gameObject.scaleY);
}
else
{
return this.setBodySize(this.body.size.x * scaleX, this.body.size.y * scaleY);
}
}
};
module.exports = BodyScale;

View File

@ -0,0 +1,78 @@
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2020 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var TYPE = require('../TYPE');
/**
* The Impact Body Type component.
* Should be applied as a mixin.
*
* @namespace Phaser.Physics.Impact.Components.BodyType
* @since 3.0.0
*/
var BodyType = {
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.BodyType#getBodyType
* @since 3.0.0
*
* @return {number} [description]
*/
getBodyType: function ()
{
return this.body.type;
},
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.BodyType#setTypeNone
* @since 3.0.0
*
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setTypeNone: function ()
{
this.body.type = TYPE.NONE;
return this;
},
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.BodyType#setTypeA
* @since 3.0.0
*
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setTypeA: function ()
{
this.body.type = TYPE.A;
return this;
},
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.BodyType#setTypeB
* @since 3.0.0
*
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setTypeB: function ()
{
this.body.type = TYPE.B;
return this;
}
};
module.exports = BodyType;

View File

@ -0,0 +1,74 @@
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2020 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
/**
* The Impact Bounce component.
* Should be applied as a mixin.
*
* @namespace Phaser.Physics.Impact.Components.Bounce
* @since 3.0.0
*/
var Bounce = {
/**
* Sets the impact physics bounce, or restitution, value.
*
* @method Phaser.Physics.Impact.Components.Bounce#setBounce
* @since 3.0.0
*
* @param {number} value - A value between 0 (no rebound) and 1 (full rebound)
*
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setBounce: function (value)
{
this.body.bounciness = value;
return this;
},
/**
* Sets the minimum velocity the body is allowed to be moving to be considered for rebound.
*
* @method Phaser.Physics.Impact.Components.Bounce#setMinBounceVelocity
* @since 3.0.0
*
* @param {number} value - The minimum allowed velocity.
*
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setMinBounceVelocity: function (value)
{
this.body.minBounceVelocity = value;
return this;
},
/**
* The bounce, or restitution, value of this body.
* A value between 0 (no rebound) and 1 (full rebound)
*
* @name Phaser.Physics.Impact.Components.Bounce#bounce
* @type {number}
* @since 3.0.0
*/
bounce: {
get: function ()
{
return this.body.bounciness;
},
set: function (value)
{
this.body.bounciness = value;
}
}
};
module.exports = Bounce;

View File

@ -0,0 +1,116 @@
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2020 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var TYPE = require('../TYPE');
/**
* The Impact Check Against component.
* Should be applied as a mixin.
*
* @namespace Phaser.Physics.Impact.Components.CheckAgainst
* @since 3.0.0
*/
var CheckAgainst = {
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.CheckAgainst#setAvsB
* @since 3.0.0
*
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setAvsB: function ()
{
this.setTypeA();
return this.setCheckAgainstB();
},
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.CheckAgainst#setBvsA
* @since 3.0.0
*
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setBvsA: function ()
{
this.setTypeB();
return this.setCheckAgainstA();
},
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.CheckAgainst#setCheckAgainstNone
* @since 3.0.0
*
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setCheckAgainstNone: function ()
{
this.body.checkAgainst = TYPE.NONE;
return this;
},
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.CheckAgainst#setCheckAgainstA
* @since 3.0.0
*
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setCheckAgainstA: function ()
{
this.body.checkAgainst = TYPE.A;
return this;
},
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.CheckAgainst#setCheckAgainstB
* @since 3.0.0
*
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setCheckAgainstB: function ()
{
this.body.checkAgainst = TYPE.B;
return this;
},
/**
* [description]
*
* @name Phaser.Physics.Impact.Components.CheckAgainst#checkAgainst
* @type {number}
* @since 3.0.0
*/
checkAgainst: {
get: function ()
{
return this.body.checkAgainst;
},
set: function (value)
{
this.body.checkAgainst = value;
}
}
};
module.exports = CheckAgainst;

View File

@ -0,0 +1,150 @@
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2020 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var COLLIDES = require('../COLLIDES');
/**
* @callback CollideCallback
*
* @param {Phaser.Physics.Impact.Body} body - [description]
* @param {Phaser.Physics.Impact.Body} other - [description]
* @param {string} axis - [description]
*/
/**
* The Impact Collides component.
* Should be applied as a mixin.
*
* @namespace Phaser.Physics.Impact.Components.Collides
* @since 3.0.0
*/
var Collides = {
_collideCallback: null,
_callbackScope: null,
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.Collides#setCollideCallback
* @since 3.0.0
*
* @param {CollideCallback} callback - [description]
* @param {*} scope - [description]
*
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setCollideCallback: function (callback, scope)
{
this._collideCallback = callback;
if (scope)
{
this._callbackScope = scope;
}
return this;
},
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.Collides#setCollidesNever
* @since 3.0.0
*
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setCollidesNever: function ()
{
this.body.collides = COLLIDES.NEVER;
return this;
},
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.Collides#setLiteCollision
* @since 3.6.0
*
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setLiteCollision: function ()
{
this.body.collides = COLLIDES.LITE;
return this;
},
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.Collides#setPassiveCollision
* @since 3.6.0
*
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setPassiveCollision: function ()
{
this.body.collides = COLLIDES.PASSIVE;
return this;
},
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.Collides#setActiveCollision
* @since 3.6.0
*
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setActiveCollision: function ()
{
this.body.collides = COLLIDES.ACTIVE;
return this;
},
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.Collides#setFixedCollision
* @since 3.6.0
*
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setFixedCollision: function ()
{
this.body.collides = COLLIDES.FIXED;
return this;
},
/**
* [description]
*
* @name Phaser.Physics.Impact.Components.Collides#collides
* @type {number}
* @since 3.0.0
*/
collides: {
get: function ()
{
return this.body.collides;
},
set: function (value)
{
this.body.collides = value;
}
}
};
module.exports = Collides;

119
node_modules/phaser/plugins/impact/components/Debug.js generated vendored Normal file
View File

@ -0,0 +1,119 @@
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2020 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
/**
* The Impact Debug component.
* Should be applied as a mixin.
*
* @namespace Phaser.Physics.Impact.Components.Debug
* @since 3.0.0
*/
var Debug = {
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.Debug#setDebug
* @since 3.0.0
*
* @param {boolean} showBody - [description]
* @param {boolean} showVelocity - [description]
* @param {number} bodyColor - [description]
*
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setDebug: function (showBody, showVelocity, bodyColor)
{
this.debugShowBody = showBody;
this.debugShowVelocity = showVelocity;
this.debugBodyColor = bodyColor;
return this;
},
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.Debug#setDebugBodyColor
* @since 3.0.0
*
* @param {number} value - [description]
*
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setDebugBodyColor: function (value)
{
this.body.debugBodyColor = value;
return this;
},
/**
* [description]
*
* @name Phaser.Physics.Impact.Components.Debug#debugShowBody
* @type {boolean}
* @since 3.0.0
*/
debugShowBody: {
get: function ()
{
return this.body.debugShowBody;
},
set: function (value)
{
this.body.debugShowBody = value;
}
},
/**
* [description]
*
* @name Phaser.Physics.Impact.Components.Debug#debugShowVelocity
* @type {boolean}
* @since 3.0.0
*/
debugShowVelocity: {
get: function ()
{
return this.body.debugShowVelocity;
},
set: function (value)
{
this.body.debugShowVelocity = value;
}
},
/**
* [description]
*
* @name Phaser.Physics.Impact.Components.Debug#debugBodyColor
* @type {number}
* @since 3.0.0
*/
debugBodyColor: {
get: function ()
{
return this.body.debugBodyColor;
},
set: function (value)
{
this.body.debugBodyColor = value;
}
}
};
module.exports = Debug;

View File

@ -0,0 +1,71 @@
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2020 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
/**
* The Impact Friction component.
* Should be applied as a mixin.
*
* @namespace Phaser.Physics.Impact.Components.Friction
* @since 3.0.0
*/
var Friction = {
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.Friction#setFrictionX
* @since 3.0.0
*
* @param {number} x - [description]
*
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setFrictionX: function (x)
{
this.friction.x = x;
return this;
},
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.Friction#setFrictionY
* @since 3.0.0
*
* @param {number} y - [description]
*
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setFrictionY: function (y)
{
this.friction.y = y;
return this;
},
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.Friction#setFriction
* @since 3.0.0
*
* @param {number} x - [description]
* @param {number} y - [description]
*
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setFriction: function (x, y)
{
this.friction.x = x;
this.friction.y = y;
return this;
}
};
module.exports = Friction;

View File

@ -0,0 +1,56 @@
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2020 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
/**
* The Impact Gravity component.
* Should be applied as a mixin.
*
* @namespace Phaser.Physics.Impact.Components.Gravity
* @since 3.0.0
*/
var Gravity = {
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.Gravity#setGravity
* @since 3.0.0
*
* @param {number} value - [description]
*
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setGravity: function (value)
{
this.body.gravityFactor = value;
return this;
},
/**
* [description]
*
* @name Phaser.Physics.Impact.Components.Gravity#gravity
* @type {number}
* @since 3.0.0
*/
gravity: {
get: function ()
{
return this.body.gravityFactor;
},
set: function (value)
{
this.body.gravityFactor = value;
}
}
};
module.exports = Gravity;

View File

@ -0,0 +1,44 @@
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2020 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
/**
* The Impact Offset component.
* Should be applied as a mixin.
*
* @namespace Phaser.Physics.Impact.Components.Offset
* @since 3.0.0
*/
var Offset = {
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.Offset#setOffset
* @since 3.0.0
*
* @param {number} x - [description]
* @param {number} y - [description]
* @param {number} [width] - [description]
* @param {number} [height] - [description]
*
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setOffset: function (x, y, width, height)
{
this.body.offset.x = x;
this.body.offset.y = y;
if (width)
{
this.setBodySize(width, height);
}
return this;
}
};
module.exports = Offset;

View File

@ -0,0 +1,70 @@
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2020 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
/**
* The Impact Set Game Object component.
* Should be applied as a mixin.
*
* @namespace Phaser.Physics.Impact.Components.SetGameObject
* @since 3.0.0
*/
var SetGameObject = {
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.SetGameObject#setGameObject
* @since 3.0.0
*
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
* @param {boolean} [sync=true] - [description]
*
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setGameObject: function (gameObject, sync)
{
if (sync === undefined) { sync = true; }
if (gameObject)
{
this.body.gameObject = gameObject;
if (sync)
{
this.syncGameObject();
}
}
else
{
this.body.gameObject = null;
}
return this;
},
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.SetGameObject#syncGameObject
* @since 3.0.0
*
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
syncGameObject: function ()
{
var gameObject = this.body.gameObject;
if (gameObject)
{
this.setBodySize(gameObject.width * gameObject.scaleX, gameObject.height * gameObject.scaleY);
}
return this;
}
};
module.exports = SetGameObject;

View File

@ -0,0 +1,94 @@
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2020 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
/**
* The Impact Velocity component.
* Should be applied as a mixin.
*
* @namespace Phaser.Physics.Impact.Components.Velocity
* @since 3.0.0
*/
var Velocity = {
/**
* Sets the horizontal velocity of the physics body.
*
* @method Phaser.Physics.Impact.Components.Velocity#setVelocityX
* @since 3.0.0
*
* @param {number} x - The horizontal velocity value.
*
* @return {this} This Game Object.
*/
setVelocityX: function (x)
{
this.vel.x = x;
return this;
},
/**
* Sets the vertical velocity of the physics body.
*
* @method Phaser.Physics.Impact.Components.Velocity#setVelocityY
* @since 3.0.0
*
* @param {number} y - The vertical velocity value.
*
* @return {this} This Game Object.
*/
setVelocityY: function (y)
{
this.vel.y = y;
return this;
},
/**
* Sets the horizontal and vertical velocities of the physics body.
*
* @method Phaser.Physics.Impact.Components.Velocity#setVelocity
* @since 3.0.0
*
* @param {number} x - The horizontal velocity value.
* @param {number} [y=x] - The vertical velocity value. If not given, defaults to the horizontal value.
*
* @return {this} This Game Object.
*/
setVelocity: function (x, y)
{
if (y === undefined) { y = x; }
this.vel.x = x;
this.vel.y = y;
return this;
},
/**
* Sets the maximum velocity this body can travel at.
*
* @method Phaser.Physics.Impact.Components.Velocity#setMaxVelocity
* @since 3.0.0
*
* @param {number} x - The maximum allowed horizontal velocity.
* @param {number} [y=x] - The maximum allowed vertical velocity. If not given, defaults to the horizontal value.
*
* @return {this} This Game Object.
*/
setMaxVelocity: function (x, y)
{
if (y === undefined) { y = x; }
this.maxVel.x = x;
this.maxVel.y = y;
return this;
}
};
module.exports = Velocity;

26
node_modules/phaser/plugins/impact/components/index.js generated vendored Normal file
View File

@ -0,0 +1,26 @@
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2020 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
/**
* @namespace Phaser.Physics.Impact.Components
*/
module.exports = {
Acceleration: require('./Acceleration'),
BodyScale: require('./BodyScale'),
BodyType: require('./BodyType'),
Bounce: require('./Bounce'),
CheckAgainst: require('./CheckAgainst'),
Collides: require('./Collides'),
Debug: require('./Debug'),
Friction: require('./Friction'),
Gravity: require('./Gravity'),
Offset: require('./Offset'),
SetGameObject: require('./SetGameObject'),
Velocity: require('./Velocity')
};