Engineering case study · 03
Live · Open source under MIT
Duck Hunt: Unplugged
The classic NES Duck Hunt — reimagined with hand tracking.
- codebase
- Vanilla TypeScript
- rendering
- WebGPU/WebGL
- streak multipliers
- ×2–×5
Aim with a hand. Shoot with a pinch.
No controller is needed. The game reads a webcam feed with MediaPipe HandLandmarker, smooths the aim position with linear interpolation, and turns a three-dimensional finger-distance gesture into a shot.
Pinch detection uses hysteresis so a hand near the threshold does not flicker between states. Shots are edge-triggered, which means one pinch produces one shot instead of firing on every animation frame.
A small, deliberate game loop
PixiJS v8 renders through WebGPU or WebGL, while the Web Audio API handles the sound layer. The game adds progressive difficulty, ×2–×5 streak multipliers, and a localStorage high score.
The application is built in Vanilla TypeScript without a framework and released under the MIT license.