mirror of
https://github.com/photonstorm/phaser
synced 2025-01-11 04:38:51 +00:00
38 lines
514 B
JavaScript
38 lines
514 B
JavaScript
|
var Velocity = {
|
||
|
|
||
|
setVelocityX: function (x)
|
||
|
{
|
||
|
this.vel.x = x;
|
||
|
|
||
|
return this;
|
||
|
},
|
||
|
|
||
|
setVelocityY: function (y)
|
||
|
{
|
||
|
this.vel.y = y;
|
||
|
|
||
|
return this;
|
||
|
},
|
||
|
|
||
|
setVelocity: function (x, y)
|
||
|
{
|
||
|
this.vel.x = x;
|
||
|
this.vel.y = y;
|
||
|
|
||
|
return this;
|
||
|
},
|
||
|
|
||
|
setMaxVelocity: function (x, y)
|
||
|
{
|
||
|
if (y === undefined) { y = x; }
|
||
|
|
||
|
this.maxVel.x = x;
|
||
|
this.maxVel.y = y;
|
||
|
|
||
|
return this;
|
||
|
}
|
||
|
|
||
|
};
|
||
|
|
||
|
module.exports = Velocity;
|