accelerometer calibration???
scitunes
Member, Sous Chef Posts: 4,047
Anyone figure this out yet? I'd love to have my game use the accelerometer at a 45 angle.
Comments
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_acceleromete
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
Were you able to post a sample game? If so what is the name?
Thanks
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
It's ripped right from my Z is for Zombie game, and shows you how I calibrate the phone, display the current calibration and how the player uses that information.
there is a limitation, it only works up to about a 60 degree angle from the top, after that the controls get screwy. I'm sure there is a way to fix it with a few extra rules, but I havn't actually attempted to yet.
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
http://gamesalad.com/game/play/30319
only the survival and settings buttons work.
Click on survival to see the game work without calibration. then click pause to exit back to the main screen to go into settings and calibration.
then go back to survival to see the updated settings.
you can poke around the settings, I also included how i turn off and on accelerometer control, as well as sound / music (but there are better ways of doing this, it was my first attempt)
let me know if you have any questions!
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left