using GS, I'd like to achieve the following:
- Players have a score, starting at 1000
- In the game, 2 players face each other
- When the game ends, the winning and losing players both submit their game outcome (cheat prevention)
- The winning player receives 10 points
- The losing player loses 10 points
- A leaderboard can be displayed showing the player score in comparison to other players
What I have done already are the first 3 points. I am able to detect which player won and then I could add the score.
Could you please generally point me in the right direction, I'm struggeling a bit with the documentation as it seems my usecase is a bit different
- How would I ideally store the player points? scriptData?
- How can I show this data in the leaderboard?
- How can I make sure the leaderboard stays updated?
I think a challenge leaderboard might be the best way to achieve this. We have a guide on how to set one up here. Essentially players will be playing and submitting scores to the leaderboard. You can set a target score which when hit, will decide who the winner is. At this point the winner will get a ChallengewonMessage and the loser will get a ChallengeLostMessage. When using a leaderboard in a challenge a ChallengechangedMessage will be sent to the player each time a score is submitted. So this message would be a good way to keep each player updated as it will contain the latest scores for each. Does this approach sound like it would work for you ?