EEGscape

Blink to play

Three mini games, one Muse headset. Turning signals into game controls.

At Hack Western 11, we made three mini games using a Muse headset. EEGscape was our take on brain-computer interface (BCI) games, combining EEG signals, blinks, and head movements. We won Best Video Game Hack.

The EEGscape team demonstrating the Muse headset and games
Trying the headset at Hack Western 11. Photo: Big Blue Bubble.

From signal to input

A blink leaves a large electrical signal in the headset readings. To turn that into a button, we took channel 0, applied a bandpass filter configured to keep 0.1–50 Hz, and tracked its smoothed RMS amplitude. The smoothing made the decision depend on an envelope instead of individual samples jumping around.

Smoothed amplitude · simplified from EEGContext.jsxjs
mean = 0.995 * mean + 0.005 * sample;
rms = Math.sqrt(
  0.995 * rms ** 2 + 0.005 * (sample - mean) ** 2
);
const blinkDetected = rms > 20;

Once the value crossed 20, a blink became eligible to drop a block. A 1.5-second cooldown limited repeated inputs while the signal stayed high. Channel 3 used the same amplitude threshold for the game's “focus” flag, a simple heuristic rather than a measured attention score.

01 / filterChannel 0 · 0.1–50 Hz
02 / envelopeSmoothed RMS amplitude
03 / trigger> 20 · 1.5 s cooldown
threshold / 20smoothed amplitudetime →
32

Above threshold → blink eligible → drop a block, when the cooldown allows.

Illustrative signals, not recorded EEG. Thresholds follow the game code; sliders stand in for the headset.

The FFT view split the signal into delta, theta, alpha, beta, and gamma band power so we could inspect its frequency content. That display was separate from the amplitude-based game controls.

Head tracking came from the accelerometer. We converted its x, y, z readings into angles, saved a neutral pose, and used the difference as input. A rotating 3D cube made the movement visible. Side tilts crossed ±30° to trigger a nod; returning inside the threshold re-armed it.

Signal exploration · Game signal processing · Input thresholds

Three mini games

  • Tower Stack. Blink to drop a moving block. Only the overlapping part survives, leaving less room for the next drop.
  • Memory. Watch a growing sequence, then repeat it with left, down, and right head gestures.
  • GyroFocus. Tilt to line up two markers. Stay within 7° of the target with the focus flag active for three seconds to score.

The hackathon

I built this with Fatih Nararya, Dhir Pathak, and Nathan Schultz. We each went home with a Nintendo Switch Lite for winning Best Video Game Hack.

EEGscape teammates holding their Nintendo Switch Lite prizes with the Hack Western award presenters
The team with our prizes. Photo: Big Blue Bubble.