Advanced Accelerometer Help
I followed T Shirt Booth's accelerometer tutorial. The game works great if you want to hold the iphone completely flat. But I would like to change the configuration so people who are sitting and holding the iphone at an angle (maybe 30 degrees) can also play the game.
Does anyone know what I need to change the numbers to?
For example, right now, each direction is: if the game.accelerometer is < (or >) -0.1 (or 0.1), So, what would I need the numbers to be?
THANKS!
Does anyone know what I need to change the numbers to?
For example, right now, each direction is: if the game.accelerometer is < (or >) -0.1 (or 0.1), So, what would I need the numbers to be?
THANKS!
Best Answer
-
scitunes Posts: 4,047
Here's what I do. Create a calibrate button or just use your start button on your main menu. Add the following code for a landscape game:
change attribute game.Calibrate (real) to abs(game.accelerometer.X)
Then in the tilt controlled actors do this:
Any where that you have used game.accelerometer.X change it to this:
(game.accelerometer.X+game.Calibrate)
Answers
So when (game.acelerometer.X+game.calibrate) > 0.1
The problem I am having is that I can't get (game.acelerometer.X+game.calibrate) inside the field. It only allows me to select one attribute. When I try to add both, it just overwrites the other. If I try and write it in the field, it doesn't work. ???
Is there any way to make the actor move when I slightly tilt the device. It seems that I need to tilt the device quite a bit for it to move forward or backward. ??? Thanks!
I also tried without the calibration, and the sensitivity works just fine.
Anyone have any ideas?
what ive always done is change calibrate to game.Accelerometer.X *-1
Try that for your calibrate attribute, and see if you can adjust the sensitivity then. Might not make a differnce worth a shot though.
The 0.1 or 0.000000000001 won't make a diffference for the accelerometer being registered. It is the accelerate behavior amount in the rule that makes the difference.