This repo contains two browser-based brain-controlled games built with OpenBCI EEG signals:
game
– Controlled by eye blinking (alpha wave spikes)eye_game
– Controlled by horizontal eye movement (based on two channels: N1P and N2P)
- Blinking (or closing your eyes) generates a spike in alpha bandpower.
- This spike causes the bird to flap (jump).
- Gameplay is similar to Flappy Bird: avoid obstacles by blinking at the right time.
- EEG Alpha band from a frontal electrode (e.g., Fp1 / Fp2)
- Detects relaxed (eyes closed) state
- Uses two EEG channels:
N1P
andN2P
(left/right near eyes) - Movement is determined by comparing the signal difference:
diff = N2P - N1P
- Move a square left or right by moving your eyes
- Raw signal difference between left and right eye channels
- No ML, no alpha — just real-time directional EEG
- Use Cyton board or compatible device
- Set
N1P
andN2P
as active channels - Go to Networking tab:
- Stream:
UDP
- IP:
127.0.0.1
- Port:
12345
- Stream type:
Band Power
orRaw
- Stream:
From the root directory:
node server.js
It will show:
✅ UDP server listening on port 12345
For each game, do the following:
cd game # or cd eye_game
npx live-server
Then visit: http://127.0.0.1:8080
- Ensure electrodes are well placed near eyes for
eye_game
- Use
game/
if you're focusing on alpha signals and blink control - You can tweak thresholds inside
game.js
andeye_game.js
🚧 This project is actively under development — features, calibration methods, and signal processing logic are evolving rapidly.