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

40 lines
555 B
JavaScript
Raw Normal View History

2017-08-15 22:36:00 +00:00
var Velocity = {
setVelocityX: function (x)
{
this.vel.x = x;
return this;
},
setVelocityY: function (y)
{
this.vel.y = y;
return this;
},
setVelocity: function (x, y)
{
if (y === undefined) { y = x; }
2017-08-15 22:36:00 +00:00
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;