Accelerometer Problem , Help needed !
marwanbarakat
PRO Posts: 41
Hi guys,
I'm making a portrait shooting game and im using the accelerometer to move the cursor. It looks like a game called High Noon
I'm using the following rules in the cursor prototype:
constrain attribute : self.motion.linear velocity.X To game.accelerometer.X * 800
constrain attribute : self.motion.linear velocity.Y To game.accelerometer.Y * 800
the 1st rule is 100% working as I need , but the 2nd is only working when the ( accelerometer Y ) has a positive value, that means the player has to make thier iphone in a flat (horizontal) state and tilt it down to play the game.
I tried to put a minus sign and tried to make a custom att. to change the accelerometer sign but it doesnt work.er
Please help me fixing this, or if there is any other way to do it.
Thanks
I'm making a portrait shooting game and im using the accelerometer to move the cursor. It looks like a game called High Noon
I'm using the following rules in the cursor prototype:
constrain attribute : self.motion.linear velocity.X To game.accelerometer.X * 800
constrain attribute : self.motion.linear velocity.Y To game.accelerometer.Y * 800
the 1st rule is 100% working as I need , but the 2nd is only working when the ( accelerometer Y ) has a positive value, that means the player has to make thier iphone in a flat (horizontal) state and tilt it down to play the game.
I tried to put a minus sign and tried to make a custom att. to change the accelerometer sign but it doesnt work.er
Please help me fixing this, or if there is any other way to do it.
Thanks
Answers
Constrain to abs(game.accelerometer.Y * 800)
for eg.. u cud something like
self.motion.linear velocity.Y To (game.startaccelValue-game.accelerometer.Y) * 800
Not sure if that'll help.. Lemme know..