Mark players own score in scoreboard results

It would be cool if the receiving players own scores were highlighted in some way in the returned results.

This would let me track the player's own scores and treat them in a different way, such as:

  • highlight the player's own score visually
  • substitute "you" for their name
  • show relative changes as they move up/down the board
  • keep a history if their ranking changes

Apologies if I'm missing something that already exists.

eg. when receiving scores that contain one originally submitted from my device/account name "matt"

{
	lastUpdated = 649972900,
	scores = [
		{
			rank = 1,
			player = "mario",
			value = 100
		},
		{
			rank = 2,
			player = "matt",
			value = 42,
			own = true
		},
		{
			rank = 3,
			player = "luigi",
			value = 20
		}
	]
}
5 Likes

Alternatively, a way to retrieve the current device name would work. But that gives mean icky feeling for some reason.

I think that you can do this using playdate.scoreboards.getPersonalBest(boardName, callback) and check if the rank match one of the entries.

Oh, yes! Thanks

How did I miss that?

Looks like it will return the name too. I'll try it out.

The score board functionality is very interesting, but I could not find a reference to it in Inside Playdate, but did find details at Scoreboard API - Playdate Help and Playdate.scoreboards helper script.
Is there a reason why scoreboard is not part of Inside Playdate?

It’s a catalog-only feature, so I assume it’s not something they really show off until you’re approved

It is available only to games distributed via Catalog. But here are the docs: