MCPcopy
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / updateTargetHealth

Function updateTargetHealth

assets/js/block_ninja.js:993–1006  ·  view source on GitHub ↗
(target, healthDelta)

Source from the content-addressed store, hash-verified

991
992
993const 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
1009const returnTarget = target => {

Callers 2

block_ninja.jsFile · 0.85
tickFunction · 0.85

Calls 1

makeTargetGlueColorFunction · 0.85

Tested by

no test coverage detected