Page 1 of 1

Google Play Games Services

Posted: Mon Jan 11, 2016 8:33 pm
by GiveMeAnthony
I'm wondering about how one might integrate Google Play Games Services into a Love2D project running with love-android-sdl2. I know Love2D comes with LuaJIT and FFI, so you can call native C functions like so

Code: Select all

local ffi = require("ffi")

ffi.cdef[[
int printf(const char *fmt, ...);
]]
ffi.C.printf("%s running on %s %s\n", jit.version, jit.os, jit.arch)

function love.load()
	love.window.setMode( 120, 100 )
	love.graphics.setBackgroundColor(80, 80, 80)
end

function love.draw()
	love.graphics.printf("Check terminal...", 0, love.graphics.getHeight()/2 - 12, love.graphics.getWidth(), "center")
end
Not that this example is particularly useful, but you can see that we can execute C functions nicely. This all nice and dandy, but it doesn't seem to help for accessing Play Games APIs. They offer an API for Android, C++, and for Web via REST. So I'm thinking "How should I implement this?". Do I need a special Java/Android interface for Lua/Love2D? Perhaps a C++ interface would be better? Should I use LuaJIT FFI to call a C function which then uses JNI? Should I somehow use their REST API (I'm unsure of the limitations)?

Re: Google Play Games Services

Posted: Tue Jan 12, 2016 7:30 am
by bobbyjones
Their rest api most likely require HTTPS which love doesn't include sadly. But there are other threads that show how to integrate Google play services. I'm sure you can adapt them for your needs. I would also like to say that if you do code your own solution please share it with us \o/ lol.