The RCWeb Tankwar Control App (app/tankwar-control) acts as the dedicated driving interface for the Tankwar game, designed under the Asymmetric Pattern. It transforms a mobile screen into a dual-thumb complex vector control system.


--player-hue) directly injecting the specific color ID the host server randomly assigned to the player ensuring no team confusion.The logic primarily revolves around math-heavy pointer event handling and strict bandwidth throttling inside script.js.
sendTouch function anchors tracking on continuous pointer drags. It calculates the raw distance from the exact center of the touchPadEle bounding box (Math.hypot(dx, dy)). It mathematically normalizes these coordinates mathematically to return a clean vector (-1.0 to 1.0) across X and Y, alongside a normalized strength scalar (0 to 1).comms.js WebSocket infrastructure. Instead, the logic modifies an internal outboundState object locally and implements an external window.setInterval(flushOutboundState, 100) heartbeat loop. This guarantees state packets are strictly rate-limited safely to merely 10 per second maximum.flushOutboundState compares the pending outbound network update against a cached lastSentState memory block. If the player hasn't moved their thumb or pressed fire, no packets leave the device.