Game Development Reference
In-Depth Information
The Skiing project
This chapter sees Facebook support being added to the Skiing project. The
Facebook.cpp and Facebook.h files created for the Facebook project have been
added to the Skiing project unchanged in order to support posting a message to
the user's wall.
When the player reaches the "game over" screen, a check is made to see if Facebook
support is available. If it isn't, the normal "game over" message is displayed and after
a short delay the user will return to the title screen.
If Facebook functionality is available, a slightly different "game over" screen is
displayed. This version informs the player of their score and then asks if they wish
to post a message on their wall to boast about it to their friends. Buttons marked Yes
and No are provided to allow the player to choose what to do.
If they click on the Yes button, the game will attempt to log in to Facebook and then
post a message detailing the player's score. The request also references an image file
and a web page link that will also be displayed alongside the wall message.
As with the previous Facebook project, it is necessary to create your own Facebook
App and supply the correct values for the App Id, App Secret, and the iphone-
bundle-url-schemes setting.
Summary
In this chapter we've taken a quick look at how to add various kinds of online
services to our games. Specifically, we've seen how to add Facebook support to
our titles and now know where to start looking should we want to include social
gaming, advertising, or in-app purchases.
Each of these topics could easily fill an entire chapter, but unfortunately there just
isn't room in this topic to go any deeper. Hopefully you now have a good idea of
the options available though.
At several points in this chapter the Extensions Development Kit (EDK) was
mentioned as a possible way of implementing online features that are currently
not supported as part of the base Marmalade SDK. In the next chapter, we will be
taking a look at the EDK to see how we can access APIs that form part of the iOS
and Android operating systems.
 
Search WWH ::




Custom Search