Accelerometer X question , please help .

POMPOM Member Posts: 2,599
edited November -1 in Working with GS (Mac)
Hey ,
Im messing around with the accelerometer to control an actor that is flying up ,
so i have

When in portrait :
when accelerometerX > 0.2 go right and
when accelerometerX < -0.2 go left.

AND

When in portrait upsidedown :
when accelerometerX > 0.2 go left and
when accelerometerX < -0.2 go right.
________

And thats fine if im on portrait mode or upside-down portrait , but if the player holds the device in
a "horizontal" mode , the rules don't apply .

Now i would love to use portrait mode only in my game and disable auto rotate ,
it will be much easier .
will apple reject the game if it doesn't have 2 orientations?

Roy.

Comments

  • POMPOM Member Posts: 2,599
    Little bump
  • old_kipperold_kipper Member Posts: 1,420
    HI ROy, I think you can avoid Apple rejecting if you have at least 2 orientations (like your pinball and underwater basketball in loonimals?) or if the app needs to be fixed.

    As for the accel problems... Have you seen the free readout app on itunes that give the accel readings? I can't remember the name but there are a few up there I think. it's useful do avoid having to check with text display on the attributes.

    Anyway I would check the read outs and then see if you can work out which readings work best for which orientation. Its a pain in the arse but you can build calibration into the app to check and auto set up which readings to use. I have done a very simple flight sim that has some of this in but I abandoned the calibration as it would have taken too long to work out all the settings but I also found that kids naturally found the places that worked when it was fixed to a single landscape.

    cheers kipper
  • RedlerTechRedlerTech Member Posts: 1,583
    Hey Roy,
    Just implement the landscape orientations. This way, when your user is in the middle from portrait and portrait upside down, they still have control.

    Matt
  • POMPOM Member Posts: 2,599
    Thanks guys for your reply ,
    i made simple project with 3 display text to see the X Y Z values of the accelerometer in all kind of orientations , and i figured it out, instead of using when "Portrait" i use when y < 0
    And instead of using "portrait upside down" i use when y > 0
    It works great even in horizontal mode now .

    Roy.
Sign In or Register to comment.