added custom labels
This commit is contained in:
parent
8a05e060c5
commit
a8410d83d0
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue