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

73 lines
1.4 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.Bounce
* @since 3.0.0
*/
2017-08-15 22:36:00 +00:00
var Bounce = {
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.Bounce#setBounce
* @since 3.0.0
*
2018-03-18 23:42:09 +00:00
* @param {number} value - [description]
*
2018-03-18 23:42:09 +00:00
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
2017-08-15 22:36:00 +00:00
setBounce: function (value)
{
this.body.bounciness = value;
return this;
},
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.Bounce#setMinBounceVelocity
* @since 3.0.0
*
2018-03-18 23:42:09 +00:00
* @param {number} value - [description]
*
2018-03-18 23:42:09 +00:00
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setMinBounceVelocity: function (value)
{
this.body.minBounceVelocity = value;
return this;
},
/**
* [description]
*
* @name Phaser.Physics.Impact.Components.Bounce#bounce
2018-03-18 23:42:09 +00:00
* @type {number}
* @since 3.0.0
*/
bounce: {
2017-08-15 22:36:00 +00:00
get: function ()
{
return this.body.bounciness;
},
set: function (value)
{
this.body.bounciness = value;
}
}
};
module.exports = Bounce;