gbusto / BrickBreak

An attempt to make a game like "Ballz" or "Bricks and Balls".
1 stars 0 forks source link

Add User Encouragement and Feedback Based on Leaderboard Position #539

Closed gbusto closed 5 years ago

gbusto commented 5 years ago

When a user is logged into GameCenter, get their position on the leaderboard and congratulate them if they make it to within a certain percentage of the entire leaderboard. Also if the user isn't logged into GameCenter, notify them and tell them what they get with it.

Maybe this encouragement can be displayed on the Game Menu based on their position on the leaderboard. The "Congratulations!" popup can be immediately when they break a record based on their score/level count. I don't want to keep all of this in a persistent data structure because every time I update that structure in the future, the data will be lost (although this can maybe be fixed by me checking to see if the saved file for a structure is present, if it is load it into the old data structure and copy those fields into the new data structure, and write the new data structure to disk and remove the old one).

The other cool thing is to give the user immediate feedback about their position in the game. If they're playing classic mode and they reach 247 (for example) and only 50% of users ever make it that far, let them know with some popup.

gbusto commented 5 years ago

Typical flow could be something like:

  1. Log into GameCenter if it's enabled and they have an account
  2. Get their current classic and level rank
  3. Ensure that what's on disk matches what GameCenter says and if not, write the correct scores to disk
  4. Return the user's level/classic rank in functions
  5. When a user completes a level, report the new score to GameCenter and if they moved up in rank, prompt them with a dialog that congratulates them before the ad! OR when the user either loses in classic mode, puts the game into the background/terminates it, or every 10 turns, report the new score to GC and prompt them if they moved up in rank. Need to ensure that this is in line with when classic state gets saved off, we don't want GC classic score to diverge from classic mode state.

Need to expose functions to save/load scores from game center, update score on disk, report new high scores, and retrieve and store their current rank. There may be no way to determine the rank of those above and below them, so the only way we know if they moved up or down in rank is if we keep it persisted.

gbusto commented 5 years ago

Information I could report to the user:

I don't think it would be good to let the user know when they slip in rank because it could be demoralizing. Instead, I think the best and simplest path forward is to prompt the user when they're within 10 levels of the person in front of them, or 100 points behind the next ranked person and tell them they're close to moving up in rank.

gbusto commented 5 years ago

Separating this out into 2 tickets: #638 and #640. #638 is done already, but I don't have a good plan for creating a prompt, what it should look like, what it should say, and when to show it. So until that time I will not finish the second half of this issue (#640).