A ball that lights up when change in orientation or tilt

How about reading about how they work?

As you are new to this then it will not be "easy".

One application here.....