added custom labels

This commit is contained in:
Josh Guyette 2022-06-26 21:44:24 -05:00
parent 8a05e060c5
commit a8410d83d0
2 changed files with 5 additions and 3 deletions

View File

@ -27,14 +27,16 @@ const Balloon = ({ body, color }: any) => {
};
export default (
label: string,
world: Matter.Composite,
color: ColorValue,
pos: Position2D,
size: Size2D
) => {
const body = Matter.Bodies.circle(pos.x, pos.y, 50, {
label: "Balloon",
label,
isStatic: false,
id: 5,
// restitution: 0.4,
// friction: 1,
frictionAir: 0.5,

View File

@ -23,14 +23,14 @@ const Wall = ({ body, color }: any) => {
)
}
export default (world: Matter.Composite, color: ColorValue, pos: Position2D, size: Size2D) => {
export default (label: string, world: Matter.Composite, color: ColorValue, pos: Position2D, size: Size2D) => {
const body = Matter.Bodies.rectangle(
pos.x,
pos.y,
size.width,
size.height,
{
label: 'Wall',
label,
isStatic: true
} as Matter.IChamferableBodyDefinition
)