Page 33 of 33

Re: love-android-sdl2 (native, 0.9.2)

Posted: Tue Sep 29, 2015 4:28 pm
by slime
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! :)
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.

Re: love-android-sdl2 (native, 0.9.2)

Posted: Tue Oct 13, 2015 2:59 pm
by L13B3
slime wrote:
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! :)
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.
Oh wonderful! I was able to figure it out, 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!

Re: love-android-sdl2 (native, 0.9.2)

Posted: Tue Oct 13, 2015 4:05 pm
by slime
LÖVE includes [wiki]enet[/wiki] and lua[wiki]socket[/wiki] modules.

Re: love-android-sdl2 (native, 0.9.2)

Posted: Mon Dec 07, 2015 5:54 am
by TurtleP
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)

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
Could it be that it's only getting the direction of the axis should it be the X?

Re: love-android-sdl2 (native, 0.9.2)

Posted: Sat Dec 19, 2015 10:44 am
by kbmonkey
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.