Android tilt
Posted: Mon Mar 13, 2023 11:02 pm
I see some games on android using tilt control like DUAL https://play.google.com/store/apps/deta ... n_US&pli=1 but I don't see anything in love2D to do that, would it still be possible?
Code: Select all
local joystick
function love.load()
joystick = love.joystick.getJoysticks()[1] -- note, that you may like to get all joystick and select the best one, this just gets the first one
end
function love.update(dt)
local x, y, z = joystick:getAxes() -- now you can get orientation of phone and process it
end