Hold your phone in landscape and tilt left and right to steer the paddle.
On a phone: tilt to steer, tap to launch. On a desktop: move the mouse or use the arrow keys, space to launch, P to pause.
Tilt Breakout is the classic brick-breaker, steered by the physical orientation of your phone. Hold the device in landscape and roll it left or right; the paddle accelerates in that direction rather than snapping to a position, so it carries momentum and has to be steered into place.
Everything runs client-side on a <canvas> — no server round trips, no game state
leaves the browser.
The deviceorientation event reports the device's attitude as three Euler angles
(alpha, beta, gamma) applied in Z-X'-Y'' order. Those angles are
relative to the device, not to what you see, so they cannot be used directly: the same physical
motion produces different numbers in portrait and in each landscape direction.
Instead, the angles are converted into the direction gravity points in device coordinates,
g = ( cosβ sinγ, −sinβ, −cosβ cosγ )
and that vector is then rotated by screen.orientation.angle into screen coordinates.
Its horizontal component is the sine of the screen's roll, so taking an asin
recovers the roll as a true angle. One code path then covers every orientation, and the number means
the same thing in all of them.
Using the angle rather than the raw sine matters once the reading is calibrated. The player's grip at the moment they press start is captured as the neutral point and subtracted, and sines do not subtract evenly: from a 30° resting grip, the sine has already used up half its range, so rolling further would barely register. In angle space the same 22° of roll earns full paddle acceleration from any starting grip.
DeviceOrientationEvent.requestPermission(), and it must be called from
inside a user gesture — hence the start button.deviceorientation angles are used rather than the raw accelerometer, because
they are already gravity-corrected and drift-compensated.Accelerometer, AbsoluteOrientationSensor) is a nicer
interface but is Chromium-only, so it is not used here.updated 2026-08-09 20:30 UTC · 5ff4fb5