Working with the Accelerometer.

niwucniwuc Member Posts: 20
edited November -1 in Working with GS (Mac)
This is the last hurdle in the game I am currently facing.

I'm looking for a way to replicate the accelerometer behaviors of doodle jump. Using accelerate is too sluggish to work with the game I'm developing (A brick breaker style game). I need a way to make the controls accurate and easy.

I came across this post: http://gamesalad.com/forums/topic.php?id=3742

But I can't figure out how to make this work.

Any help will be much appreciated. Thanks.

Comments

  • niwucniwuc Member Posts: 20
    Bumping
  • niwucniwuc Member Posts: 20
    Bump
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    constrain self.positionX to self.positionX+(15*accelerometer.Y)

    This will control the horizontal movement. Change every X to a Y and Every Y to an X to control vertical movement. Change the 15 to a higher number to have a touchier faster feel or lower number to slow things down.
  • niwucniwuc Member Posts: 20
    Thank you I'll give it a shot!
  • niwucniwuc Member Posts: 20
    This worked flawlessly, thank you. All I need to do is figure out how to keep the controls from inverting if I flip the ipod.
  • amigoniamigoni Member Posts: 78
    The movement is backwards for me. I tried to changed the signs around but this completely stops movements. Help Please
Sign In or Register to comment.