From a8410d83d0a8aa1e1e0476bb73030cff205922ab Mon Sep 17 00:00:00 2001 From: Josh Guyette Date: Sun, 26 Jun 2022 21:44:24 -0500 Subject: [PATCH] added custom labels --- game/entities/Balloon.tsx | 4 +++- game/entities/Wall.tsx | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/game/entities/Balloon.tsx b/game/entities/Balloon.tsx index 8d47399..d5b248e 100644 --- a/game/entities/Balloon.tsx +++ b/game/entities/Balloon.tsx @@ -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, diff --git a/game/entities/Wall.tsx b/game/entities/Wall.tsx index 131094a..9adff87 100644 --- a/game/entities/Wall.tsx +++ b/game/entities/Wall.tsx @@ -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 )