MPU-6050 based game controller

Hi, I'd like to make a arduino gyrscope based mouse-joystick device, in particular to use the gyro to be able to control the mouse cursor precicely. Something like this: https://www.youtube.com/watch?v=ITX4711B240 or this: https://www.youtube.com/watch?v=4okgCa8kM7k However the creators seem to not be sharing the code and it seems rather complicated. Any ideas? thanks