phaser/src/physics/impact/components/Acceleration.js

71 lines
1.5 KiB
JavaScript
Raw Normal View History

2018-02-12 16:01:20 +00:00
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2018 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* [description]
*
* @name Phaser.Physics.Impact.Components.Acceleration
* @since 3.0.0
*/
2017-08-15 22:36:00 +00:00
var Acceleration = {
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.Acceleration#setAccelerationX
* @since 3.0.0
*
2018-03-18 23:42:09 +00:00
* @param {number} x - [description]
*
2018-03-18 23:42:09 +00:00
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
2017-08-15 22:36:00 +00:00
setAccelerationX: function (x)
{
this.accel.x = x;
return this;
},
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.Acceleration#setAccelerationY
* @since 3.0.0
*
2018-03-18 23:42:09 +00:00
* @param {number} y - [description]
*
2018-03-18 23:42:09 +00:00
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
2017-08-15 22:36:00 +00:00
setAccelerationY: function (y)
{
this.accel.y = y;
return this;
},
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.Acceleration#setAcceleration
* @since 3.0.0
*
2018-03-18 23:42:09 +00:00
* @param {number} x - [description]
* @param {number} y - [description]
*
2018-03-18 23:42:09 +00:00
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
2017-08-15 22:36:00 +00:00
setAcceleration: function (x, y)
{
this.accel.x = x;
this.accel.y = y;
return this;
}
};
module.exports = Acceleration;