(target, healthDelta)
| 991 | |
| 992 | |
| 993 | const updateTargetHealth = (target, healthDelta) => { |
| 994 | target.health += healthDelta; |
| 995 | // Only update stroke on non-wireframe targets. |
| 996 | // Showing "glue" is a temporary attempt to display health. For now, there's |
| 997 | // no reason to have wireframe targets with high health, so we're fine. |
| 998 | if (!target.wireframe) { |
| 999 | const strokeWidth = target.health - 1; |
| 1000 | const strokeColor = makeTargetGlueColor(target); |
| 1001 | for (let p of target.polys) { |
| 1002 | p.strokeWidth = strokeWidth; |
| 1003 | p.strokeColor = strokeColor; |
| 1004 | } |
| 1005 | } |
| 1006 | }; |
| 1007 | |
| 1008 | |
| 1009 | const returnTarget = target => { |
no test coverage detected