Game Development Reference
In-Depth Information
Chapter 6. Bragging Rights
Score is a major feature in most games. It is a way to compete with others without
even meeting them. High score lists have always been the way to show your friends
your score; however, with Windows 8 we can make that a little more direct with the in-
tegrated sharing and Live Tiles features. To do this we're going to need to make some
changes, so that when the game ends the players have a chance to see their scores,
and are prompted to share those scores - this allows us to control when the players
can share and gives them a chance to do so without ruining their games. This stop
in the action also allows us to register if they have new high scores and update the
tiles that will display the scores for them, so we need to ensure we have this in place
first. To do this we'll take advantage of the WinRT component system to make things
easier for ourselves, and learn about how you can use this to develop components in
one WinRT compliant language and consume them in another language.
Over the course of this chapter we'll take a look at the following topics:
• Game state and progression
• Adding a basic game over screen
• Sharing in Windows 8
• Share sources versus share targets
• What are Live Tiles?
• WinRT components
Let's start by setting up our game to add in these features by adding in a basic form
of game state that allows the game to end. We'll take this further in the next chapter
when we really need it to add networking. However, for now we'll just look at the ba-
sics and get what we need in place. We'll also take a look at WinRT components,
which allow us to write components in other languages and use them within our main
game with minimal performance impact. We'll use this to make it easier to work with
the Live Tiles using C#; however, from this you can learn how to integrate compon-
ents written in other languages with minimal effort.
Using the live tile system as an example, we will be able to understand how to use
these components to access functionality written in other languages, and the bene-
fits and downsides that result from using these components. Remember that all of the
functionality developed in this chapter can be developed by only using C++; however,
Search WWH ::




Custom Search