Did you know that your M-series MacBook has a lid sensor? Me neither, until I found this project on GitHub (check it out btw, it's a lot of fun). It is precise enough to tell you the angle of the lid in degrees. This gave me an idea...
Control Chrome's Dino game using your MacBook's lid angle as an input device.
Obviously, you can play any game with this script...as long as it only uses like what, two buttons? I mean...you could map a different key to each degree of the lid, but ain't no sane person is going to do that. Be my guest and open a PR if you do.
- Jump: Flick the lid upwards to simulate a spacebar press.
- Duck: Lower the lid to a certain angle to hold the down arrow key. You should still be able to (barely) see your screen.
- A MacBook with an M1 or later chip - honestly I don't really know what models are supported, so feel free to be angry if yours doesn't. I tested this on an M4 MBP, if that helps
- Python 3.8+
- Chrome
- Gentle hands. Please, for the sake of goodness, do not break your screen playing a game like this (or do, I really don't care)
- Clone the repository
- Install the packages: pip install -r requirements.txt
- Open the Dino game in Chrome
- Run the script: python main.py
- Optional: try not to break your laptop. Enjoy!
- Python
- Pybooklid
.png)
![How Much Lego Is Too Much? [video]](https://www.youtube.com/img/desktop/supported_browsers/firefox.png)
