Page 1 of 1

Has anyone used the accelerometer function with Livecode?

Posted: Sat May 19, 2012 8:05 pm
by bqsbarbqGAnC5Z
Hi everyone,

I'm trying to use the accelerometer on Livecode as a control scheme for my game, but I can't seem to return any values when I tilt my phone in the Y direction. It works just fine in X and I was wondering if anyone has successfully made any stacks that use the accelerometer because it seems like LiveCode has taken down all of their lessons on using the accelerometer. Any help would be greatly appreciated. Thanks!

Re: Has anyone used the accelerometer function with Livecode

Posted: Sat May 19, 2012 10:57 pm
by Dixie
Hi...

Code: Select all

on openCard
   mobileStartTrackingSensor "acceleration",true
end openCard

on accelerationChanged x,y,z
   put x & comma & y & comma & z into fld 1
end accelerationChanged
This returns the X,Y & Z values for me..

be well

Dixie

Re: Has anyone used the accelerometer function with Livecode

Posted: Sat May 19, 2012 11:41 pm
by bqsbarbqGAnC5Z
Whoa! Thanks! That was so simple. You're great dude (or dudette), I was way over thinking this and trying to use things like AccelerationChanged and such and it seems like it was just messing me up. Appreciate your help, this was perfect.