Adding leaderboards and achievements
So we know why leaderboards and achievements are a good thing. The first thing we need to do here is plan our achievements. A leaderboard is a high score table, and that's it! There isn't a great deal of things we can do to make them different. The achievements, however, deserve some discussion.
Planning the Snake achievements
At first, it might seem that a really simple implementation of a really simple game, like our Snake game, isn't deep enough to have many, or even any, achievements. So what follows is a quick brainstorming session of achievement ideas:
Score 10, 25, 50, 100, and so on: Simply unlock achievements at different levels of high score.
Snake length: Simply unlock achievements at different snake lengths.
Cannibal: Unlock an achievement the first time the player collides with their own tail segment.
Collect x apples in total: Keep a tally of all the apples ever collected, and unlock achievements at significant milestones.
Play 10, 25, 50, 100...