Really newbie questions about accelerometer

jb15jb15 Member Posts: 602
edited November -1 in Working with GS (Mac)
OK--I'm trying to have an actor constantly move up. Kind of like a balloon. The way to control it is to rotate the ipod, and navigate around baddies.

I know I need to look into device--accelerometer--but then--am I using X, Y, or Z? I've looked thru some of the wiki articles and such, but I still am having trouble.

Comments

  • old_kipperold_kipper Member Posts: 1,420
    CHeck out TSB cookbook vid on accelerometers.

    www.youtube.com/user/GameSaladCookbook#p/search/0/8HUCo_c2vUw

    I would think that you would probably have to have the x controlled by the x (obvious?) or possibly y depending on which orientation of the device you are using and then have the ballon on a constant speed with a braking or acceleration based on the other axis of movement.

    Good luck and stay away from self calibrating the game for starting device orientation until you have everything working if you are not too sure about it, and then if you want to get fancy...

    cheers kipper
  • jb15jb15 Member Posts: 602
    Thanks for that video. I had seen the tshirtbooth's labrynth video, but not that one.

    I'm not worried about calibrating yet (I'm a long way from that)... :)

    I think if I rephrase the question, it might help for simplicity on both ends: Let's say I want an arrow to always point towards the ground. I want earth's gravity to be the iphones gravity, so to speak. The phone is held so that the screen is at a 90 degree angle to the ground--like a wall. How can I pull a 0-360 number (for the arrow) from the X or Y (or both--I'm not sure whether I need one or two) accelerometer attributes?
  • jb15jb15 Member Posts: 602
    It's times like these where I am ashamed. Very, very, very ashamed. :)

    I just did the labrynth demo for the 4th or 5th time, and realized I could just reverse the direction of the ball--so it goes up when I when normally I'd want it to go up. I knew the answer had to be simple.

    Thanks again for your help kipper.
Sign In or Register to comment.