blaze-2d
Version:
A fast and simple WebGL 2 2D game engine written in TypeScript
30 lines • 942 B
JavaScript
import CollisionObject from "./collisionObject";
/**
* Represents a rigidbody physics object in 2D world space.
*
* Rigidbodies can collide with any Z level of terrain based on flags set.
* They can also collide with other rigidbodies.
*/
export default class RigidBody extends CollisionObject {
/**
* Creates a {@link RigidBody} with a collider, mass and restitution (bounciness).
*
* @param collider The collider of the object
* @param mass The mass of the object
* @param restitution The restitution of the object (bounciness)
*/
constructor(collider, mass, restitution) {
super(collider, mass, restitution);
/**
* Wether the body has dynamics or not.
*/
this.isDynamic = true;
}
/**
* Sets all the events that can be used in `listeners`.
*/
setupEvents() {
super.setupEvents();
}
}
//# sourceMappingURL=rigidbody.js.map