Acceleration sensor

At the beginning , I try to use acceleration sensor to create this game.

when I finish the coding ,

A big error pop out, the result is only 50% accuracy,

here is the code.

I use x-axes and z-axes to sense the movement and it can also detect the speed.

but when you brandish the sensor it will have the positive acceleration for the direction of your brandish acceleration ,

but at the end , you will decelerate , and the acceleration will become negative .

so the distinguish for the movement will be vary complicated.