pixi-fusion
Version:
This module offers a set of common components needed for playing games.
25 lines (24 loc) • 671 B
TypeScript
import Matter from "matter-js";
export type MatterPhysicsDebugConvexHullConfig = {
strokeColor?: string;
strokeWidth?: number;
};
export type MatterPhysicsConfig = {
world: {
width: number;
height: number;
};
debug?: {
convexHull?: MatterPhysicsDebugConvexHullConfig;
showConvexHull?: boolean;
};
};
export type MatterPhysics = {
readonly config: MatterPhysicsConfig;
readonly runner: Matter.Runner;
readonly engine: Matter.Engine;
run: () => void;
stop: () => void;
addBody: (body: Matter.Body | Matter.Composite) => void;
removeBody: (body: Matter.Body | Matter.Composite) => void;
};