Jump to content
Keda

Leaderboards and Game progress on Google Play Services

Recommended Posts

Hello everyone. 
I am happy to see that the delphi community is alive!

I love delphi and when I wanted to write a game I was told Unity is the way to go. 
So I wrote a game in unity but I hate it. I would like to make a game in Delphi.

However, I hit a snag... I can't find information online on about how can I save progress and use leaderboards using google play services.

On Unity it was pretty easy, but like I have said, I can't stand C# and Unity its not human friendly. At least not to my taste.

 

Can anyone please help me with a short tutorial or some sample code?

I would greatly appreciate it. 

 

Thank you.

Share this post


Link to post
12 hours ago, Keda said:

However, I hit a snag... I can't find information online on about how can I save progress and use leaderboards using google play services.

On Unity it was pretty easy, but like I have said, I can't stand C# and Unity its not human friendly. At least not to my taste.

Unless someone has done it already, I expect you're going to need to spend a fair amount of time on it.

 

This is a starting point for the leaderboard/game saving parts: 

 

https://developers.google.com/games/services/android/leaderboards

 

It would be a case of:

  • Reading the documentation, and working out which parts you want to implement
  • Working out which packages the relevant classes are in
  • Doing imports of those classes into Delphi code
  • Working out whether there are any classes you need to create descendants for, and writing the appropriate Java and associated Delphi code for them
  • Implementing the various parts in Delphi

Alternatively, you could implement a large portion of it in Java, create a .jar that Delphi would use and import the relevant parts into Delphi code.

 

I note that it requires Google Sign-in, so for that part you might want to take a look at this: 

https://github.com/grijjy/DelphiGoogleSignIn

 

Which is related to Firebase, however the Google Sign-In parts would be relevant.

  • Like 1

Share this post


Link to post

I was facing a similar issue with leaderboards and for cross-compatibility, decided to write a very simple back-end server of my own to maintain the leaderboard:

 

Wrote it in Delphi+MARS and you can find it here:

https://github.com/bLightZP/marsGameServices

 

Share this post


Link to post

Thank you so much for your replies guys.

@Yaron, thank you. But I am looking for a solution on Google Play leaderboards.
I do not own a server or anything like that. I would like to use google platform. It supports saving game progress and what not. 
People are used to it.

 

Thank you all again!

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×