Calibration of Accelerometer

joebear218joebear218 Member Posts: 33
edited November -1 in Working with GS (Mac)
Does anyone know if there is a wiki out there that explains how a user can recalibrate the accelerometer from in game?

Comments

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    Or at least how to give the player the option of a couple of different angles (0, 45, 60 for example)
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    I'm at work so I don't have my project in front of me, but I'm doing this in both my Z and V games.

    It's not too difficult, just requires a few attributes. I created two attributes called calibratedX and calibratedY.

    I then have a button called calibrate that has a rule on it, when touched it sets game.calibratedX to game.accelerometerX. Same thing for calibratedY.

    then just update your move rules to use those values instead of the stock -0.1 or 0.1

    I'll try and move my code into a sample project tonight.

    wiki page:
    http://gamesalad.com/wiki/how_tos:gsc_iphone_controls#how_do_i_make_use_of_the_iphone_ipod_touch_accelerometer
  • joebear218joebear218 Member Posts: 33
    Awesome thanks a lot mulcahy. A sample game with the calibration would be amazing. Love Z by the way I bought it yesterday in the app store.
Sign In or Register to comment.