Accelerometer

A project to port LÖVE to Android handhelds
Locked
User avatar
killer64
Prole
Posts: 14
Joined: Mon Mar 12, 2012 7:55 pm

Accelerometer

Post by killer64 »

how would i access the accelerometer in the phone (the sensor that tells you pitch and roll)
Sometimes, the elegant implementation is just a function. Not a method. Not a class. Not a framework. Just a function.
User avatar
slime
Solid Snayke
Posts: 3133
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Accelerometer

Post by slime »

It's exposed as a [wiki]Joystick[/wiki] with 3 axes.
User avatar
killer64
Prole
Posts: 14
Joined: Mon Mar 12, 2012 7:55 pm

Re: Accelerometer

Post by killer64 »

slime wrote:It's exposed as a [wiki]Joystick[/wiki] with 3 axes.
thanks, worked perfectly :>
Sometimes, the elegant implementation is just a function. Not a method. Not a class. Not a framework. Just a function.
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: Accelerometer

Post by Positive07 »

Actually pitch roll are angles... if you want the gyroscope then I'm afraid you wont be able to use it
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
Locked

Who is online

Users browsing this forum: No registered users and 63 guests