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}
|
|
|
|
*/
|
|
|
|
|
2018-02-09 01:40:41 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @name Phaser.Physics.Arcade.Components.Bounce
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2017-11-09 04:02:31 +00:00
|
|
|
var Bounce = {
|
|
|
|
|
2018-02-09 01:40:41 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @method Phaser.Physics.Arcade.Components.Bounce#setBounce
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
2018-03-18 23:29:46 +00:00
|
|
|
* @param {number} x - [description]
|
|
|
|
* @param {number} [y=x] - [description]
|
2018-02-09 01:40:41 +00:00
|
|
|
*
|
2018-05-22 08:09:28 +00:00
|
|
|
* @return {this} This Game Object.
|
2018-02-09 01:40:41 +00:00
|
|
|
*/
|
2017-11-09 04:02:31 +00:00
|
|
|
setBounce: function (x, y)
|
|
|
|
{
|
|
|
|
this.body.bounce.set(x, y);
|
|
|
|
|
|
|
|
return this;
|
|
|
|
},
|
|
|
|
|
2018-02-09 01:40:41 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @method Phaser.Physics.Arcade.Components.Bounce#setBounceX
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
2018-03-18 23:29:46 +00:00
|
|
|
* @param {number} value - [description]
|
2018-02-09 01:40:41 +00:00
|
|
|
*
|
2018-05-22 08:09:28 +00:00
|
|
|
* @return {this} This Game Object.
|
2018-02-09 01:40:41 +00:00
|
|
|
*/
|
2017-11-09 04:02:31 +00:00
|
|
|
setBounceX: function (value)
|
|
|
|
{
|
|
|
|
this.body.bounce.x = value;
|
|
|
|
|
|
|
|
return this;
|
|
|
|
},
|
|
|
|
|
2018-02-09 01:40:41 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @method Phaser.Physics.Arcade.Components.Bounce#setBounceY
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
2018-03-18 23:29:46 +00:00
|
|
|
* @param {number} value - [description]
|
2018-02-09 01:40:41 +00:00
|
|
|
*
|
2018-05-22 08:09:28 +00:00
|
|
|
* @return {this} This Game Object.
|
2018-02-09 01:40:41 +00:00
|
|
|
*/
|
2017-11-09 04:02:31 +00:00
|
|
|
setBounceY: function (value)
|
|
|
|
{
|
|
|
|
this.body.bounce.y = value;
|
|
|
|
|
|
|
|
return this;
|
|
|
|
},
|
|
|
|
|
2018-02-09 01:40:41 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @method Phaser.Physics.Arcade.Components.Bounce#setCollideWorldBounds
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
2018-05-22 02:05:37 +00:00
|
|
|
* @param {boolean} value - [description]
|
2018-02-09 01:40:41 +00:00
|
|
|
*
|
2018-05-22 08:09:28 +00:00
|
|
|
* @return {this} This Game Object.
|
2018-02-09 01:40:41 +00:00
|
|
|
*/
|
2017-11-09 04:02:31 +00:00
|
|
|
setCollideWorldBounds: function (value)
|
|
|
|
{
|
|
|
|
this.body.collideWorldBounds = value;
|
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = Bounce;
|