GodotGoogleService is a google play games integration for godot android;
cd ${GODOT_ROOT}/modules/
git clone https://github.com/FrogSquare/GodotGoogleService GodotGoogleService
git clone https://github.com/FrogSquare/GodotSql GodotSql
and you must configure your module by editing ${GODOT_ROOT}/modules/GodotGoogleService/config.py
Godot game engine:
git clone https://github.com/godotengine/godot
Login
Logout
achievements
leaderboard
- Edit file modules/GodotGoogleService/config.py at line 2
p_app_id = "com.your.appid" # config.py L:2
- Replay
com.your.appid
with you android application id.
Edit engine.cfg and add
[android]
modules="org/godotengine/godot/GooglePlay"
var google = Globals.get_singleton("GooglePlay");
var google = Engine.get_singleton("GooglePlay");
And initialize GodotGoogleService with script instance id
func _ready():
if OS.get_name() == "Android":
google.init(get_instance_id()) # use get_instance_id () for Godot 3.X
func _receive_message(tag, from, key, data):
if from == "GooglePlay":
print("Key: ", key, " Data: ", data)
google.login()
google.logout()
google.unlock_achievement("achievementID") # unlock achievement;
google.increse_achievement("achievementID", int(n)) # increse achievements by step.
google.show_achievements() # show achievements;
google.submit_leaderboard(int(score), "leaderboardID") # submit score to leaderboard
google.show_leaderboard("leaderboardID") # show leaderboard
google.show_leaderboards() # show all available leaderboard
google.get_version_code() # get package version code (Helper)
adb -d logcat godot:V GoogleService:V FrogSquare:V SignInIntentService:V SignInIntentService:V SignInActivity:V DEBUG:V AndroidRuntime:V ValidateServiceOp:V *:S
And if you are using GodotFirebase add these, GodotSQL:V FireBase:V
to the command