The Force Ball Game is an interactive game that uses EEG data to control the movement of a ball on the screen. EEG signal data is processed to simulate forces that affect the ball's trajectory, providing a unique and immersive gaming experience.
Built with Python, the game utilizes the pygame
library for graphics and pylsl
for EEG data acquisition. Players can also manually control the ball's movement using keyboard inputs.
- Real-time EEG Integration: Control the ball's movement using EEG data.
- Two Player Control: Players can adjust the force applied to the ball via keyboard controls.
- Interactive Graphics: Simple and engaging graphical interface with players and a ball.
- Python 3.x
pygame
pylsl
numpy
scipy
-
Clone the Repository
git clone https://github.com/touchhowling/BrainGame.git cd BrainGame
-
Install Dependencies
pip install pygame pylsl numpy scipy
-
Start the getArduinoData code
Ensure your EEG device is connected and run the
getArduinoData.py
script to read data from the Arduino.python getArduinoData.py
-
Run the Game
With the EEG data thread running, start the game by executing the
mygame.py
script:python mygame.py
The game window should open, displaying the interactive game interface.
Here's a preview of the game interface:
-
Drift Issue: The ball may drift over time due to accumulated small errors in position updates or force calculations. This can be mitigated by refining the position update algorithm.
-
Latency Issue: There might be latency in updating the ball's position in response to EEG data. This could be due to delays in data acquisition, processing, or rendering. Optimizing data handling and processing may help ensure smoother gameplay.
Feel free to contribute by opening issues or submitting pull requests. Your feedback and contributions are welcome!