Game Development Reference
In-Depth Information
Being able to direct the user to a website can be extremely useful for things such as
instruction manuals, hints and tips, or technical support access. It is also great for
cross promotion of titles by making it really simple to deliver a Get More Games
button that highlights other games you have created.
How do we accomplish this magic? It's really simple! Just include the header file
s3eOSExec.h and then make a call to s3eOSExecAvailable to see if the functionality
is supported by the platform we are running on. Most of the platforms supported by
Marmalade allow this functionality, but it is always best to check!
If support is available, all we have to do is call the function s3eOSExecExecute
with the URL of the web page and a Boolean value indicating whether or not our
application will quit. On platforms that don't support multi-tasking this parameter
will make no difference, so it is usually OK to set this flag to false to ensure that our
application is not closed down.
Here's a code snippet to illustrate:
if (s3eOSExecAvailable())
{
s3eOSExecExecute(" http://www.google.com ", false);
}
The main disadvantage of this approach is that by launching the application in
the device's internal web browser, it takes the user away from our game; but in
the cases mentioned previously, this may be an acceptable trade-off given how
easy it is to implement.
Integrating with social media
Social media sites such as Facebook provide a great way of advertising our games by
getting our players to spread the word for us. There are countless examples of games
which allow players to post a message to their Facebook wall or Twitter feed to show
off their latest high score or boast about achieving a certain target in the game.
In this section we will take a detailed look at how we can implement integration with
Facebook and we will also talk briefly about Twitter.
Using Facebook
Marmalade comes with an API called s3eFacebook that wraps up most of the tricky
stuff involved in communicating with the Facebook servers. Unfortunately this ease
of use does come at a price, which is that it is only supported on iOS and Android.
 
Search WWH ::




Custom Search