Arduino Leonardo + GY_85 as headtracker

Hello,

I am a newbie when it comes to sensors, but what I want to do, is to make a head tracker (actually a gun tracker) for use with Battlefield 4. Therefore I want to put a GY_85 sensor inside a wooden gun to track its movement.

I've tried a lot combining some codes I found on the internet but I can't get it to work with my GY_85. In the following instructable, someone made a head tracker using a LSM9DS0 sensor:

I think that's exactly what I need because it moves the mouse when the head moves in a direction, and he uses it with Minecraft.

If someone could help me out what I need to change in his code I would really appreciate that.

Thanks in advantage