@rpgjs/physic
Version:
A deterministic 2D top-down physics library for RPG, sandbox and MMO games
35 lines (34 loc) • 667 B
JavaScript
import { Vector2 } from "./index2.js";
class EntityMovementBody {
constructor(entity) {
this.entity = entity;
}
get id() {
return this.entity.uuid;
}
get position() {
return this.entity.position;
}
get velocity() {
return this.entity.velocity;
}
setVelocity(velocity) {
this.entity.setVelocity(velocity);
}
translate(delta) {
this.entity.position.addInPlace(new Vector2(delta.x, delta.y));
}
isStatic() {
return this.entity.isStatic();
}
/**
* Returns the underlying entity reference.
*/
getEntity() {
return this.entity;
}
}
export {
EntityMovementBody
};
//# sourceMappingURL=index31.js.map