How to solve this issue with the accelerometer function?
![gawakamy](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
Hi, GS dudes.
I am developing a game which use the accelerometer function. This game must be played with only accelerometer. There are characters, and they will move around tilting device. When I made it, the characters move only right upside and are stuck in the right upside corner. This is what I made as below.
= Accelerometer logic =
When Attribute. game.AccelerometerX > 0.01
Then Accelerometer Direction=180 Relative to scene, Acceleration=200
When Attribute. game.AccelerometerX < -0.01
Then Accelerometer Direction=0 Relative to scene, Acceleration=200
When Attribute. game.AccelerometerY > 0.01
Then Accelerometer Direction=90 Relative to scene, Acceleration=200
When Attribute. game.AccelerometerY < -0.01
Then Accelerometer Direction=270 Relative to scene, Acceleration=200
= Character logic =
Constrain Attribute self.Motion.Linear Velocity.X To abs(game.Accelerometer.X)*150
Constrain Attribute self.Motion.Linear Velocity.Y To abs(game.Accelerometer.Y)*150
I am developing a game which use the accelerometer function. This game must be played with only accelerometer. There are characters, and they will move around tilting device. When I made it, the characters move only right upside and are stuck in the right upside corner. This is what I made as below.
= Accelerometer logic =
When Attribute. game.AccelerometerX > 0.01
Then Accelerometer Direction=180 Relative to scene, Acceleration=200
When Attribute. game.AccelerometerX < -0.01
Then Accelerometer Direction=0 Relative to scene, Acceleration=200
When Attribute. game.AccelerometerY > 0.01
Then Accelerometer Direction=90 Relative to scene, Acceleration=200
When Attribute. game.AccelerometerY < -0.01
Then Accelerometer Direction=270 Relative to scene, Acceleration=200
= Character logic =
Constrain Attribute self.Motion.Linear Velocity.X To abs(game.Accelerometer.X)*150
Constrain Attribute self.Motion.Linear Velocity.Y To abs(game.Accelerometer.Y)*150
Answers
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS