Integrating with Twitter
Twitter is an amazing way to share simple information with other people. You may want to use it in two ways:
Allow the player to log in, thus providing a unique username
Allow the player to tweet his/her high score or progression in the game
You will now see two possibilities to integrate your game with it.
Twitter for dummies
There is a very simple way to use Twitter that doesn't even require you to use any kind of API. If the user is already logged in to Twitter, you can prompt him/her to submit a prewritten tweet, simply by opening a URL. This URL is formatted as follows:
http://twitter.com/home?status=Pre written status here!
The highlighted part of this address is the status you wrote for the player. What we could do in our game is to provide a tweet
this
link next to the Submit button on the leaderboard screen:
$.ajax({ dataType: "json", url: "highscore.php", data: { // ... }, async: false, success: function (json) { var top = ""; for (var...