The [wiki]love.touch[/wiki] API in (the work-in-progress) LÖVE [wiki]0.10.0[/wiki] uses pixels rather than [0, 1] like the 0.9.2 mobile API does – you're probably using 0.10.0 rather than 0.9.2.L13B3 wrote:Second, when I put it in portrait mode, the touchpressed, released and moved seemed to return x and y in terms of pixels rather than the usual [0,1] and I cannot for the life of me guess why that is.
Any thoughts?
Thanks!
love-android-sdl2 (native, 0.9.2)
- slime
- Solid Snayke
- Posts: 3166
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: love-android-sdl2 (native, 0.9.2)
Re: love-android-sdl2 (native, 0.9.2)
Oh wonderful! I was able to figure it out, thanks!slime wrote:The [wiki]love.touch[/wiki] API in (the work-in-progress) LÖVE [wiki]0.10.0[/wiki] uses pixels rather than [0, 1] like the 0.9.2 mobile API does – you're probably using 0.10.0 rather than 0.9.2.L13B3 wrote:Second, when I put it in portrait mode, the touchpressed, released and moved seemed to return x and y in terms of pixels rather than the usual [0,1] and I cannot for the life of me guess why that is.
Any thoughts?
Thanks!
And I had no idea 0,10,0 was on its way and it's going to support mobile!
But until then (and even then this may be a valid question), is there any way to implement online features using love for android? Like to make a multiplayer game? Or is that beyond the scope of this, and more in line with messing with the Android stuff? I have minimal experience programming for Android, so I'm not even sure where I'd begin to add networking features and link them with this build.
Thanks again!
- slime
- Solid Snayke
- Posts: 3166
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: love-android-sdl2 (native, 0.9.2)
LÖVE includes [wiki]enet[/wiki] and lua[wiki]socket[/wiki] modules.
Re: love-android-sdl2 (native, 0.9.2)
So I've successfully submitted my game, Turtle: Invaders to the play store. I have a known issue, however. The gyroscope seems to sometimes mess up with the axis directions. By this I mean the player will get stuck going towards the right side of the screen, but it can be fixed if the user adjusts the phone. Not sure what it is.
Axis passed is from:
android = love.joystick.getJoysticks()[1] (created on loading the game)
Value is passed from android:getAxis(1)
Could it be that it's only getting the direction of the axis should it be the X?
Axis passed is from:
android = love.joystick.getJoysticks()[1] (created on loading the game)
Value is passed from android:getAxis(1)
Code: Select all
function gyro:axis(axis, value)
if not objects then
return
end
local player = objects["turtle"][1]
local deadZone = 0.12
if axis == 1 then
if value > deadZone then
player:moveright()
elseif value >= 0 and value < deadZone then
player:stopright()
elseif value < -deadZone then
player:moveleft()
elseif value > -deadZone and value <= 0 then
player:stopleft()
end
end
if axis == 3 then
if value == -1 then
player:specialUp()
end
end
end
Re: love-android-sdl2 (native, 0.9.2)
I just built my first love-to-android game with this port and it works. I love it, thanks for this.
Edit: Provided a link to the release if anyone is keen to play pinball on the Android devices.
Edit: Provided a link to the release if anyone is keen to play pinball on the Android devices.
Who is online
Users browsing this forum: No registered users and 0 guests