Has anyone used the accelerometer function with Livecode?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
bqsbarbqGAnC5Z
Posts: 77
Joined: Thu Dec 08, 2011 12:19 pm

Has anyone used the accelerometer function with Livecode?

Post by bqsbarbqGAnC5Z » Sat May 19, 2012 8:05 pm

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!

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: Has anyone used the accelerometer function with Livecode

Post by Dixie » Sat May 19, 2012 10:57 pm

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

bqsbarbqGAnC5Z
Posts: 77
Joined: Thu Dec 08, 2011 12:19 pm

Re: Has anyone used the accelerometer function with Livecode

Post by bqsbarbqGAnC5Z » Sat May 19, 2012 11:41 pm

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.

Post Reply