Due to Covid, almost all aspects of school and work alike have shifted to the computer. While it might be nice to work from home, it is also very straining on your eyes to be staring at a computer screen for the entire day. The symptoms for eye strain include headaches and eye pain, among others. To combat this, we have decided to produce a game that exercises your eye as you play through different eye movements and blinking. Our team got the idea to address this topic through the combination of the Dell and HPE challenges.

What it does

Our game is a spin on the classic rhythm game, with the player using their eyes rather than using their keyboard or mouse to interact with the game. Arrows fall from the top of the screen at certain time intervals, and when the arrow reaches the bottom of the screen you must either blink or look to the side of the screen that matches with the arrow direction. Eye exercises have been proven to reduce eye fatigue, and by playing the game your eyes should feel less fatigued than before.

How we built it

With Python, we used the gaze_tracking library for our eye tracking (which included the use of openCV and dlib), as well as making the actual game through Pygame. For the music we used "Slow Motion" by Bensound to create a peaceful backdrop to our gameplay.

Challenges we ran into

Three of us were new to hackathons so we had to spend a bunch of time at first deciding how we wanted to go about things. At first we wasted multiple hours trying to figure out a project and then once we decided on this idea we started to look for libraries. The problem we ran into is we started using a library that didn't support webcams at first and required more expensive hardware we did not have access to. After figuring out things we wanted to implement things went more smoothly.

The gaze_tracker module only had no up and down capabilities so we reassembled the left and right functions to fit our needs better. The tracker boundaries had to be adjusted and sometimes the lighting is just not good enough for a playable environment. On the pygames side the issues mostly correlated with getting detection to work properly and trying to randomly spawn arrows at a decent rate.

Accomplishments that we're proud of

Getting the eye tracking software to work as well as getting the game to produce arrows at a smooth rate. We are also proud of being able to research modules that fit our needs to create a project. Another thing we are proud of is just simply being able to turn in a working project within the time frame. The last thing I am proud of is that during the loading screen I added a feature from THE professor Ritchey himself.

What we learned

We learned how to effectively use the eyetracker and dlib to modify the prexisting code into something that fit our needs better. Due to our research on the topic we also learned some exercises to better prevent eye strain which were incorporated into our game. Pygames required a bit of brushing up on objects and sound effects.

What's next for eyeTrain

We could add predetermined move sets for songs in the future and would also like to create a leaderboard for others to compete against one another. One other thing we would like to do is have a completely established start menu and pause menu.

Built With

+ 6 more
Share this project: