My new Windows Phone 7 game, Friends Guess was recently approved in the Zune marketplace. It is now available to Windows Phones.
To play Friends Guess you are given the name of one of your Facebook friends and then you have to match the name to one of six profile pictures in the screen. It is a fun way of keeping up to date with your friend’s profile pictures. You will be surprise at the pictures your friends choose for their profiles; I sometimes ask myself, “is that their profile picture now? no way…” when playing the game. The idea of the game came from wife, while we were driving back from our vacation in Virginia.
There is a web based version of the game at http://friendsguess.appspot.com if you don’t have a Windows Phone. This web version should work on the iPhone too and possible Android phones (depending on your OS version). The web version has a slightly different scheme for scoring, but the mechanics are as fun as the Windows Phone version.
From a programming perspective, it was a lot of fun to learn the Facebook Graph API, which is incredibly well designed to work with pretty much any programming language that can do web requests. For the Mango version of the game, however, I was able to take advantage of the Facebook integration on Windows Phone 7 and pulled friend’s Facebook profile picture straight from the phone contacts. Something like this:
public void GetPics() { Contacts cons = new Contacts(); //Identify the method that runs after the asynchronous search completes. cons.SearchCompleted += new EventHandler<ContactsSearchEventArgs>(Contacts_SearchCompleted_One); //Start the asynchronous search. cons.SearchAsync(String.Empty, FilterKind.None, "My app"); } void Contacts_SearchCompleted_One(object sender, ContactsSearchEventArgs e) { LinkedList<FacebookPicturePair> friends = new LinkedList<FacebookPicturePair>(); try { foreach (Contact con in e.Results) { if (con.Accounts.Any(a => a.Kind == StorageKind.Facebook)) { BitmapImage img = new BitmapImage(); img.SetSource(con.GetPicture()); friends.AddLast(new FacebookFriend() { Picture = img, Name = con.DisplayName }); } } } catch (Exception) { //We can't get a picture of the contact. //.. error handling here } return friends; }
Comments