RCWeb Stack Fall

Stack Fall (app/stack-fall) is the shared-screen display for a physics balancing game built around the RCWeb asymmetric app pattern. The large screen shows three independent lanes, a QR code for phone controllers, the global drop countdown, and the live towers as they wobble, collide, and settle.

Open the display on a TV, projector, laptop, or large monitor, then let players scan the QR code to join with stack-fall-c. The display is the single source of truth for each lane: it chooses each drop shape, runs the timer, owns the Box2D physics world, decides when pieces have balanced, and restarts a lane when one of its pieces falls below the floor.

icon

Screenshot

screenshot

The Game

Stack Fall is a modern block-stacking challenge inspired by tower games and falling-block puzzles. Each lane starts with only a floor. Every drop cycle gives all lanes the same Tetris-style shape, so active players and open stacks face the same physical problem at the same time.

During the five-second aiming window, each lane has one piece at the top of the screen. A connected player can move their piece with the phone slider or optional phone tilt. If a lane has no player, or the player is not touching the slider, the piece makes small left/right idle movements on its own. When the countdown reaches zero, all active pieces release together with no horizontal launch velocity and fall onto their lane's floor or existing stack.

A piece can tip, lean, slide, or hang over an edge and the player can continue as long as it remains above the floor. When a player or open stack drops a block below the floor, only that lane pauses, tilts its own floor to clear the pieces, levels the floor again, resets its balanced count, and then rejoins the synchronized drop cycle. If a tower reaches the drop zone at the top of the screen, that lane alternates its blocks between their lane color and white five times at 200 ms intervals, waits five seconds, then clears itself with the same floor-tilt reset. Other lanes continue playing while that happens.

How To Play

Open /stack-fall/?r=<room> on the shared screen. Players scan the QR code to open /stack-fall-c/?r=<room> on their phones. Up to 3 players can join, one per lane.

If a controller disconnects or leaves the room, the display frees that lane immediately. The tower remains on screen, but the lane becomes an open stack again and continues with automatic idle aiming until another phone joins.

Each lane runs its own tower round inside the repeated synchronized drops:

  • The display picks one shared shape for the next drop.
  • Every available lane receives that same shape at the top of the screen.
  • Players have 5 seconds to aim.
  • All pieces release at the same time.
  • Settled pieces count as balanced.
  • If a lane drops a piece below the floor, that lane performs its own tilt-clear-reset cycle and starts again from zero.
  • If a lane reaches the top drop zone, its blocks flash white five times before the same lane reset begins.

When no players have joined yet, all three lanes still run as open stacks. Each open lane keeps accepting drops until one of its pieces falls below the floor, then that lane performs the same independent reset before allowing new drops again.

Display Layout

The display is designed for shared landscape screens while still functioning in portrait. The visual style uses a black OLED-friendly background with saturated RGB lane colors and neon HUD accents. The main playfield keeps the falling pieces clear of player status text and the QR code. The Stack Fall title sits at the top left, while the bottom panel is reserved for lane info, connection status, and the QR code. The global countdown number and progress bar sit at the top center so the drop timer is visible without covering the pieces being aimed.

Window resizing is handled with the physics layout in mind. Height-only changes resize the canvas, rebuild the floor collision bodies at the new bottom position, and move existing stacks with the floor. Width changes refresh the display page because lane widths and block fixtures are tied to the Box2D world geometry.

Powered By RCWeb

Stack Fall uses RCWeb's room-based WebSocket layer through comms.js. The display publishes a QR code with the room already embedded, then receives controller intents through rc.sendFunctionCall.

The display intentionally keeps communication event-based. Controllers send updates only when the slider, touch state, name, reset request, or tilt value changes. The countdown is maintained locally from timestamps in snapshots, avoiding constant WebSocket traffic.

Implementation Notes

  • Physics uses the shared Box2DWeb JavaScript library at /assets/lib/box2dweb-2.1.0-b/package/box2d.js.
  • Falling pieces are compound Box2D bodies made from square fixtures, allowing I, O, T, L, J, S, and Z style shapes to tumble as single rigid pieces.
  • The display isolates collisions by lane so stacks do not interfere with neighboring towers.
  • stack-fall targets the controller app stack-fall-c with tailored snapshots for each joined player.
  • The display watches RCWeb client presence and removes disconnected controllers from their lane so the slot becomes available again.
  • The QR code is created with rc.buildQRCodePanel() to match other RCWeb apps.
DocumentationServer TelemetryServer StatsServer HTTP LogServer WebSocket Log