# RCWeb Invaders Control App

The **RCWeb Invaders Control App** (`app/invaders-c`) is the companion phone controller for the shared-screen Invaders viewer.

![icon](pwa-512x512.png "Invaders Control Icon")

## What it does

- **Dedicated ship controls**: Each phone controls one ship with left, right, and fire actions.
- **Per-player HUD**: The controller receives targeted updates for score, lives, round, rank, and moment-to-moment status.
- **One-tap replay**: A reset button can restart the shared campaign from the controller side.

## How it works

- **Presence registration**: On connect, the controller announces itself to the `invaders` viewer so a ship can be created for this client.
- **State-based input**: The controller continuously sends a compact movement and firing state to the viewer with `rc.sendFunctionCall`.
- **Viewer feedback loop**: The viewer targets this specific controller client with `invadersControl.registerPlayer`, `invadersControl.updateState`, and `invadersControl.showPulse`.
