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!
Has anyone used the accelerometer function with Livecode?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 77
- Joined: Thu Dec 08, 2011 12:19 pm
Re: Has anyone used the accelerometer function with Livecode
Hi...
This returns the X,Y & Z values for me..
be well
Dixie
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
be well
Dixie
-
- Posts: 77
- Joined: Thu Dec 08, 2011 12:19 pm
Re: Has anyone used the accelerometer function with Livecode
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.