love-android-sdl2 (native, 0.9.2)

A project to port LÖVE to Android handhelds
User avatar
slime
Solid Snayke
Posts: 2700
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

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

Post by slime » Tue Sep 29, 2015 4:28 pm

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.

L13B3
Prole
Posts: 2
Joined: Tue Sep 29, 2015 3:46 pm

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

Post by L13B3 » Tue Oct 13, 2015 2:59 pm

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!

User avatar
slime
Solid Snayke
Posts: 2700
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

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

Post by slime » Tue Oct 13, 2015 4:05 pm

LÖVE includes [wiki]enet[/wiki] and lua[wiki]socket[/wiki] modules.

User avatar
TurtleP
Party member
Posts: 146
Joined: Thu Mar 22, 2012 9:20 pm
Contact:

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

Post by TurtleP » Mon Dec 07, 2015 5:54 am

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?

User avatar
kbmonkey
Citizen
Posts: 88
Joined: Tue Sep 01, 2015 12:19 pm

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

Post by kbmonkey » Sat Dec 19, 2015 10:44 am

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.

Locked

Who is online

Users browsing this forum: No registered users and 1 guest