Étude de cas 09 / 12

← Tous les projets

Cette étude de cas n'est disponible qu'en anglais pour l'instant.

Space Shooter

Your phone is the controller. Tilt to steer, tap to fire.

Brief
Cross-device browser game built on WebRTC
Role
Concept, visual design & full-stack development
Format
Desktop game + mobile controller, Node.js
Status
School project · Web 4
Space Shooter gameplay: meteorites falling towards the rocket, with the score in the corner

An arcade shooter on your screen, steered by the phone in your hand.

The desktop browser becomes the game screen and your smartphone becomes a wireless controller. Meteorites fall from the sky while your rocket waits at the bottom. Tilt the phone to move, tap to fire a laser. Scan a QR code and you're playing: no app, no install, no keyboard.

No app. No cables.
Just scan, tilt and shoot.

A server introduces the two devices, then steps out of the way.

01

Scan to connect

The desktop shows a QR code with its socket id. Scanning it opens the controller on the phone.

02

WebSocket signalling

A small Node, Express and socket.io server only relays the offer, answer and ICE candidates.

03

Peer-to-peer data

Tilt and fire commands then travel directly phone-to-desktop over a WebRTC DataChannel, with near-zero lag.

04

Desktop runs the game

Physics, collisions, score and difficulty all live on the desktop canvas. The phone only sends input.

The connect screen: scan the QR code to connect your controller

Most of the work was making it feel natural on a real phone.

01

Landscape, like a real remote

Holding the phone upright felt wrong, so the controller asks you to rotate and reads the beta axis, clamped to ±45° for snappy steering.

02

Gyro on iOS

iOS only grants gyroscope access over HTTPS and after a tap, so the server runs on a certificate and a start button asks permission.

03

Sound across two devices

Web haptics are blocked on iPhone, so the laser plays on the phone as instant feedback, while explosions and an 8-bit Interstellar theme play on the desktop.

The phone controller's start screen: Space Shooter, ready to play, Start
The phone controller in game, with the score and a fire button
How the connection works: the phone scans a QR code; a Node, Express and socket.io signalling server relays the offer, answer and ICE candidates over WebSockets; then the phone controller and the desktop game talk directly over a WebRTC DataChannel, sending move and fire messages.

Real-time only feels effortless when every state is handled.

Play-testing exposed a race: tapping Start before the peer connection was open sent the ready signal into the void. Queuing it until the channel opens, plus a clear state model (QR only while disconnected, game over only while connected) made the game reliable. I used AI as a starting point and rewrote whatever didn't hold up on real devices.