toggle menu
Categories
Discussions
Dashboard
Sign In
·
Register
Sign In
·
Register
Categories
Discussions
Dashboard
Sign In
·
Register
×
Home
›
GameSalad 101
›
Working with GS (Mac)
Calibration of Accelerometer
joebear218
Member
Posts:
33
December 2009
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
scitunes
Member, Sous Chef
Posts:
4,047
December 2009
Or at least how to give the player the option of a couple of different angles (0, 45, 60 for example)
jonmulcahy
Member, Sous Chef
Posts:
10,408
December 2009
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
joebear218
Member
Posts:
33
December 2009
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.
Comments
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