The example game, called Space Aim 3D, also contains the World, Web, and Help screens. The first one will present the image from the camera, together with indicators representing the players in the vicinity. However, for now you just need to create a simple screen with a black background and a localized header. The page does not contain any other controls, thus the code of the view and view model is really simple.
The
Web screen is related to operations performed using the social networks and RSS feeds. The arrangement of the screen is a bit more complex, however, it uses elements that you got to know earlier. The view model for this page should contain four commands (CmdFacebook
, CmdTwitter
, CmdRate
, and CmdWebsite
) that are executed when the player clicks on the relevant buttons (Publish at Facebook wall, Tweet at Twitter, Rate Space Aim 3D, and Open project website). Of course, you should also prepare a preliminary version of the four private methods that are called when particular commands are used (for example, PublishAtWall
, Tweet
, Rate
, and OpenProjectWebsite
). However, currently you can implement only the method for the CmdWebsite
command, using the OpenWebsite
static method from the GameHelpers
class, as explained earlier.
The next page, called
Help, contains some advice related to the game, including information about the game goals, steering, and contact data. It allows the player to open the project website and its profile on Facebook, as well as the ability to send e-mail message to the developer. The last feature is implemented by the SendEmail
method in the GameHelpers
class:
public static void SendEmail(string toAddress, string subject)
{
EmailComposeTask ect = new EmailComposeTask();
ect.Subject = subject;
ect.To = toAddress;
ect.Show();
}
Composing an e-mail message can be performed by using the EmailComposeTask
class. Its various properties allow specifying, for example, a subject (Subject
) and a recipient for the message (To
). Opening an e-mail client for writing the message is performed automatically after calling the Show
method. You can also add the public constant field (AUTHOR_EMAIL
) to the GameHelpers
class that stores an e-mail address of the author. Thus, you can use it in many pages, and easily modify, if necessary.
Regarding the view model, the HelpViewModel
class contains three properties representing commands (CmdWebsite
, CmdProfile
, and CmdEmail
). Currently, you can create an implementation for all the related private methods, for example, OpenProjectWebsite
, OpenFacebookProfile
, and SendMessage
. They should call the OpenWebsite
and SendMessage
helper methods from the GameHelpers
class.
18.118.12.50