Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by Aries

Hi, I wanted to do a accelerometer based game.

The game will use the accelerometer to control the position of the character such as Temple Run.

However, I found out that is a lot of noise when reading the accelerometer.

Is that anyway to control the position of the character in more accurate way?

1 decade ago by dominic

Impact gives you the raw, unfiltered accelerometer values. You can smoothen out the noise with a simple high pass filter:

this.smoothAccelX = (this.smoothAccelX * 0.9) + (ig.input.accel.x * 0.1);

This takes "nine parts" of the old value and "one part" of the current raw value to get the new value.
Page 1 of 1
« first « previous next › last »