UNPKG

blaze-2d

Version:

A fast and simple WebGL 2 2D game engine written in TypeScript

27 lines (26 loc) 887 B
import Collider from "./collider/collider"; 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 { /** * Wether the body has dynamics or not. */ isDynamic: boolean; /** * 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: Collider, mass?: number, restitution?: number); /** * Sets all the events that can be used in `listeners`. */ protected setupEvents(): void; }