Găsiți următoarea book favorită
Deveniți un membru astăzi și citiți gratuit pentru 30 zileÎncepeți perioada gratuită de 30 zileInformații despre carte
Windows Phone 8 Game Development
Până la Marcin Jamro
Acțiuni carte
Începeți să citiți- Editor:
- Packt Publishing
- Lansat:
- Sep 20, 2013
- ISBN:
- 9781849696814
- Format:
- Carte
Descriere
Informații despre carte
Windows Phone 8 Game Development
Până la Marcin Jamro
Descriere
- Editor:
- Packt Publishing
- Lansat:
- Sep 20, 2013
- ISBN:
- 9781849696814
- Format:
- Carte
Despre autor
Legat de Windows Phone 8 Game Development
Mostră carte
Windows Phone 8 Game Development - Marcin Jamro
Table of Contents
Windows Phone 8 Game Development
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Getting Started
Windows Phone platform
Managed, native, and hybrid development
Managed approach
Native approach
Hybrid approach
First steps
Software Development Kit
Integrated Development Environment
Developer account registration
Phone registration
Concept of the game
Objective
Screens
Architecture
Programming languages and technologies
Summary
2. Game User Interface
New project
Project structure
Manifest file
Application lifecycle
First screen
Required modifications
New application page
Working with designer
Working with the XAML code
Layout controls
Grid
StackPanel
Canvas
Screen layout
Background
Menu options
Styles
Handling events
Separate event handlers
Common event handler
Navigating between pages
Running
Debugging
Resources shared among all screens
Data binding
Localization
Summary
3. MVVM Design Pattern
Model-View-ViewModel
Simple implementation
Menu screen
Map screen
View
View model
Model
Ranks screen
Model
RankItem class
RankTopScoreConverter class
View model
View
RankControl user control
Ranks page
Settings screen
World, Web, and Help screens
Game screen
Summary
4. 3D Graphics Basics
Introduction to 3D graphics
Vertices, indices, coordinates, and faces
Model, view, and projection matrices
Rendering pipeline
Shaders
Direct3D-related part
Windows Phone Runtime Component
Direct3DInterop class
Direct3DBase class
CubeRenderer class
Fields
Device resources
Resources dependent on the window size
Updating
Rendering the scene
Shaders
GamePage.xaml.cs
Necessary modifications
Native part debugging
Summary
5. 3D Game World
Planet model
Creating model
Adding model file
Importing model
VertexData structure
GameHelpers class
ModelLoader class
Placing a model in the game world
MVPConstantBuffer structure
Object3D class
GameHelpers class
Constants
Planet class
GameRenderer class
Adding asteroids to the game world
Asteroid class
GameRenderer class
Flying towards the planet
Rocket class
GameRenderer class
Summary
6. Steering, Sensors, and Collision Detection
Rocket steering
Steering by accelerometer
Rocket class
GameRenderer class
Game world limitation
Engine power adjustment
Rocket class
GameRenderer class
Direct3DInterop class
Game levels
Implementation
Constants
Game class
GameRenderer class
Collision detection
Concept
Implementation
CollisionDetector class
GameRenderer class
Improving performance
Update operation
Render operation
Other sensors in the native part
Writing to output
Gyrometer
Compass
Interactive Help screen
HelpPage.xaml
HelpPage.xaml.cs
HelpViewModel.cs
Other sensors in the managed part
Gyroscope
Summary
7. 2D User Interface in 3D Game
DirectX Tool Kit
Game states
Concept
Implementation
Constants
Game class
GameRenderer class
Rocket display
Concept
Texture
Font
Implementation
Constants
RocketDisplay class
GameRenderer class
Localized strings
Concept
Implementation
Constants
LocalizedStrings class
Level countdown
Concept
Implementation
Constants
Countdown class
GameRenderer class
Direct3DInterop class
GamePage class
Menus
Concept
Implementation
Constants
Localized strings
MenuItem class
MenuButton class
MenuLabel class
Menu class
GameRenderer class
Direct3DInterop class
GamePage class
Summary
8. Maps, Geolocation, and Augmented Reality
Maps and geolocation
Windows Phone Toolkit
Installation
Ambiguous reference error
Locations of other players
PlayerData.cs
MapViewModel.cs
MapPage.xaml
MapPage.xaml.cs
Your location
MapViewModel.cs
MapPage.xaml
Augmented reality
Geo Augmented Reality Toolkit
Locations of other players
ARItemExtended.cs
WorldViewModel.cs
WorldPage.xaml
WorldPage.xaml.cs
Error message
VisibilityConverter.cs
WorldViewModel.cs
App.xaml
WorldPage.xaml
Navigation to GPS coordinates
Implementation
GameHelpers.cs
MapViewModel.cs and WorldViewModel.cs
Summary
9. Exchanging Data via Web Services
SOA and WCF
Creating a web service
New project
Database
Adding SQL Server database
Players table
Results table
Access to database
Language-Integrated Query
LINQ classes
Implementation
SA3DPlayer.cs
SA3DRankItem.cs
SA3DRank.cs
ISA3DService.cs
SA3DService.cs
Web service deployment
Development deployment
IIS Express hosting
Access by IP address
Web service testing
Production deployment
Web service usage
Adding reference
Settings
Settings.cs
Ranks screen
RanksPage.xaml
RanksViewModel.cs
Map screen
MapPage.xaml
MapViewModel.cs
World screen
WorldViewModel.cs
Game screen
GameRenderer.h
Direct3DInterop.h
Direct3DInterop.cpp
GameViewModel.cs
GamePage.xaml.cs
Summary
10. Social Networks, Feeds, Settings, and Local Rank
Publishing posts with Facebook API
Creating Facebook application
Facebook C# SDK
Implementation
WebPage.xaml
WebPage.xaml.cs
WebViewModel.cs
Result
Tweeting by Twitter API
Creating Twitter application
LINQ to Twitter installation
Implementation
WebPage.xaml
WebPage.xaml.cs
WebViewModel.cs
Result
Obtaining data from RSS feeds
Implementation
News.cs
WebPage.xaml
WebViewModel.cs
Game settings
Implementation
Settings.cs
SettingsViewModel.cs
MapViewModel.cs
Local rank
Files in the isolated storage
Implementation
LocalRank.cs
RanksViewModel.cs
Direct3DInterop.h
Direct3DInterop.cpp
GamePage.xaml.cs
GameViewModel.cs
Isolated Storage Explorer tool
Summary
11. Improving Game Experience
Saving and loading the game state
Concept
Implementation
Constants.h
Game.h
GameRenderer.h
GameRenderer.cpp
Audio support
Background music
App.xaml
App.xaml.cs
SettingsViewModel.cs
Sounds
WAV file creation
Using files from sample
GameRenderer.h
GameRenderer.cpp
Video support
Concept
Implementation
CalibrationPage.xaml
CalibrationPage.xaml.cs
WorldViewModel.cs
Vibrations
Concept
Implementation
MenuViewModel.cs
GameRenderer.h
GameRenderer.cpp
Direct3DInterop.h
GamePage.xaml.cs
Speech recognition and synthesis
Concept
Speech recognition
Speech synthesis
Asynchronous operations
Implementation
MenuPage.xaml
MenuPage.xaml.cs
MenuViewModel.cs
Disabling the lock screen
Implementation
GameViewModel.cs
GamePage.xaml.cs
Summary
12. Game Publishing
Manifest file
Basic configuration
Tiles
Remaining settings
Rating by the users
Release version
Store Test Kit
Application details
Automated tests
Manual tests
Simulation Dashboard
Windows Phone Application Analysis
Frame rate counters
Certification requirements
Publishing in the store
Application information
Map credentials
View model
View
XAP submission
Updating submission
Summary
A. Useful Resources
Getting started
Game user interface
MVVM design pattern
3D graphics basics and 3D game world
Steering, sensors, and collision detection
2D user interface in a 3D Game
Maps, geolocation, and augmented reality
Exchanging data via web services
Social networks, feeds, settings, and local rank
Improving game experience
Game publishing
B. Languages and Technologies
Languages
C#
C++
XAML
Technologies and frameworks
Direct3D
WCF
.NET Framework
Index
Windows Phone 8 Game Development
Windows Phone 8 Game Development
Copyright © 2013 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: September 2013
Production Reference: 1130913
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-84969-680-7
www.packtpub.com
Cover Image by Marcin Jamro (<marcin@jamro.biz>)
Credits
Author
Marcin Jamro
Reviewer
Dave Voyles
Acquisition Editor
Edward Gordon
Lead Technical Editor
Anilia Vincent
Technical Editors
Manal Pednekar
Veena Pagare
Monica John
Pratik More
Shali Sasidharan
Project Coordinator
Rahul Dixit
Proofreaders
Clyde Jenkins
Dirk Manuel
Indexers
Tejal R. Soni
Priya Subramani
Production Coordinator
Nitesh Thakur
Cover Work
Nitesh Thakur
About the Author
Marcin Jamro is the developer and architect of various kinds of applications, such as web, mobile, and distributed ones. He is interested in many aspects of computer science, including software engineering and project management. Marcin is passionate about C#, C++, and C languages, design patterns, various technologies, and mobile devices, especially the Windows Phone platform.
He has practical experience in project development and holds the position of Chief Executive Officer at JAMROTECH Sp. z o.o. [Ltd.] (Rzeszow, Poland) which consists of activities like IT projects development, consulting, as well as conducting training. He also works at Rzeszow University of Technology and is writing a PhD thesis regarding real-time software engineering.
Marcin has published several papers, taken part in many conferences and organized a few of them, as well as participated in two internships at Microsoft in Redmond (USA). He has Microsoft Certified Professional, Microsoft Certified Technology Specialist, and Microsoft Certified Professional Developer certificates. More information about Marcin is available at his website: http://jamro.biz. You can easily contact him by sending an e-mail message to
Acknowledgments
A few months ago, my adventure with writing the first book of my life started. At the beginning, I could not even imagine how much effort will be necessary and how many people will be involved in the Windows Phone 8 Game Development book. However, after many evenings and nights spent on writing the following chapters and creating the exemplary game, it is finally ready and you can read it!
Publication of this book could not be successful without support from my family and friends who understood long hours spent on creating the book, and sometimes, a very limited time for them. What is more, I could not forget about many colleagues from the Packt Publishing Company, who helped me a lot while creating the book, preparing its final version, and publishing.
I would like to thank Poonam Jain for inviting me to write the Windows Phone 8 Game Development book, Erol Staveley for his support and helpful advices at the beginning of writing, Edward Gordon for continuing the great job of Erol, Rahul Dixit for managing the following part of the writing process, as well as Aniia Vincent, Veena Pagare, Manal Pednekar, Pratik More, Monica John, and Shali Sasidharan for their help in editing the book and finalizing it till the publication. Of course, I would also like to thank reviewers for their valuable feedback regarding the content and pointing topics which require additional clarification or modification. From my point of view, it has been a really great group of people who could always, even with friendly arguments, work together to ensure that the book has the suitable quality and is published within the expected date.
Last but not least, I really want to thank you for reading the book. I hope that you will enjoy it and that will be a good grounding for your further adventure with the Windows Phone 8 development. I hope you will create many successful projects, including great 3D games for the Windows Phone 8 platform!
About the Reviewer
Dave Voyles is a Software Engineer at Comcast in Philadelphia where he works on their Xbox Xfinity app for video streaming. In addition to that, he's an independent game developer who has launched titles on Xbox Live Indie Games, Windows 8, Windows Phone 8, and the web browser.
Dave is also an Xbox MVP and Managing Editor of Armless Octopus, a blog which provides coverage for independent gaming news, review, and previews. When he's not writing about Indies, he's supporting them through the Indie Games Uprising. As a coordinator for the Uprising, he works closely with developers and Microsoft to promote the best titles on Xbox Live Indies Games which take advantage of Microsoft's XNA framework.
Finally, Dave is also the author of another Packt Publishing book, The UnrealScript Game Programming Cookbook.
You can find more of his work at www.DavidVoyles.wordpress.com or saying hello on twitter at his handle, @DaveVoyles.
www.PacktPub.com
Support files, eBooks, discount offers and more
You might want to visit www.PacktPub.com for support files and downloads related to your book.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
http://PacktLib.PacktPub.com
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books.
Why Subscribe?
Fully searchable across every book published by Packt
Copy and paste, print and bookmark content
On demand and accessible via web browser
Free Access for Packt account holders
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.
Preface
How many of your friends do not have a mobile phone? Do you know anyone who does not use it? Currently, almost everyone has a mobile phone, and many people use more than one to communicate with family, friends, and colleagues from work. Such a fact is also confirmed by statistics. According to results presented by the International Telecommunication Union, about 6.8 billion mobile-cellular subscriptions are used (http://www.itu.int/ITU-D/ict/facts/material/ICTFactsFigures2013.pdf, 2013). That is almost the same as the number of people all over the world!
Nowadays, mobile phones can be used not only for calling and texting, but also for performing some tasks that a few years ago had been dedicated only to desktops and notebooks. They include browsing the Internet, accessing e-mail accounts, sharing files, or even performing time-consuming complex calculations. Apart from business applications, mobile devices can be used for entertainment, especially by integration with social networks and mobile games.
With the ever increasing possibilities of mobile devices, mobile games became more similar to their desktop or console versions and provide the user with similar gaming experience. Thus, a lot of people play games on their mobile phones, almost everywhere, for instance, while they are going to the workplace by bus or train, during breaks, as well as at home. As shown by SponsorPay (http://blog.sponsorpay.com/2013/02/infographic-mobile-gaming-on-the-rise, 2013), there are about 211 million mobile and social gamers in USA. What is even more surprising is that the majority of them play for more than an hour each day! The statistics presented by Geekaphone (http://geekaphone.com/blog/mobile-games-by-the-numbers, 2011) indicate that the mobile gaming industry is currently really important and may reach $11.4 billion by 2014.
The games installed on a small device that can be, almost all the time, in the pocket, can contain a complex logic, use three-dimensional graphics (3D), and have a rich user interface. They are very often equipped with a user-friendly steering mechanism that uses embedded sensors, such as an accelerometer or a gyroscope. The new mobile phones can also support the GPS (Global Positioning System) for geolocation, as well as Bluetooth for wireless communication. All of them make it possible to create a solution with really outstanding functionalities that allow the user to enjoy games directly on the mobile phone. With the usage of connectivity features, such as cellular data transmission or connection to WLAN (Wireless Local Area Network), applications can benefit from the content stored on the Internet and provide multiplayer modes. Therefore, the mobile phone can be used as a powerful game environment, even allowing cooperating with other players over the Internet.
You can also create your own games for various mobile platforms, including Windows Phone, iOS, Android, BlackBerry, or Symbian OS. Each of them has some specific features regarding available functionalities, supported sensors, used languages and technologies, as well as user interface concepts.
The Windows Phone 8 is a platform that is described in this book. As you will see, it allows creating various applications and games that can be then downloaded and used in many countries all over the world. Have you ever thought about developing your own mobile game? If so, let's start reading and writing its code!
What this book covers
Chapter 1, Getting Started, introduces the Windows Phone platform, and especially its newest version named Windows Phone 8, as well as managed, native, and hybrid development approaches. You will get to know how to install necessary software, as well as create the developer account, and register the phone. Then, a concept, rules, screens, and architecture of the exemplary game is described.
Chapter 2, Game User Interface, presents the XAML (Extensible Application Markup Language) language, as a way of creating the user interface. You will get to know the application lifecycle, controls, resources, styles, and data binding mechanism, as well as learn how to run and debug Windows Phone 8 applications.
Chapter 3, MVVM Design Pattern, covers implementation of the MVVM (Model-View-View Model) design pattern to improve the code quality. Such an approach is really useful while developing Windows Phone 8 applications.
Chapter 4, 3D Graphics Basics, introduces basic topics regarding three-dimensional graphics, such as vertices, transformations, and matrices. You will also get to know the automatically generated native part of the project, which uses Direct3D.
Chapter 5, 3D Game World, presents development of the simple 3D game world with Direct3D. You will learn how to create a simple model, load it, and place it in a particular location inside the game world.
Chapter 6, Steering, Sensors, and Collision Detection, explains how to obtain data from sensors, such as an accelerometer, gyroscope, and compass. You will also learn how to use these data to move objects in the game world, as well as how to detect collisions between them, and support multiple game levels.
Chapter 7, 2D User Interface in 3D Game, deals with using 2D graphics and fonts in the 3D game, with the DirectXTK library. You will get to know how to configure this tool, place textures, write text, as well as create menus with localized strings.
Chapter 8, Maps, Geolocation, and Augmented Reality, describes the maps, geolocation, and augmented reality features, which can be included in Windows Phone 8 applications and games. You will also learn how to start a navigation mechanism to particular GPS coordinates.
Chapter 9, Exchanging Data via Web Services, introduces the Windows Communication Foundation Service project as a way of exchanging data between players. You will get to know how to create a simple web service, deploy it locally, as well as allow the game to consume it.
Chapter 10, Social Networks, Feeds, Settings, and Local Rank, describes how you can easily integrate Windows Phone 8 applications and games with social networks, such as Facebook and Twitter. You will also learn how to read data from RSS feeds, implement game settings, as well as create the local rank.
Chapter 11, Improving Game Experience, covers many topics that improve the overall quality of the game, including saving and loading the current state, as well as supporting background music, sounds, video clips, and vibrations. You will also get to know how to recognize and synthesize speech.
Chapter 12, Game Publishing, explains a process of testing Windows Phone 8 applications and games, as well as their submission to the Windows Phone Store. You will learn how to test various aspects of the project, including performance and working in real-world conditions, as well as prepare the final version, and submit it to the store.
Appendix A, Useful Resources, suggests additional resources regarding the content of all chapters. It presents addresses of many websites, where you can find more information about topics presented in the book.
Appendix B, Languages and Technologies, introduces programming languages and technologies used in the exemplary game. You will get to know some basic information regarding C#, C++, XAML, Direct3D, WCF, and .NET Framework.
Windows Phone 8 Game Development book is a practical, hands-on guide that shows a step-by-step description of how to create a 3D game for the Windows Phone 8 platform. It presents the whole process of game development, from setting the environment to publishing the game. Thus, it gives a good grounding for the further game development adventure!
The game will combine the native and managed development approaches, and use a few languages and technologies, including C# and C++, as well as XAML and Direct3D. It will not be just a simple game. You will create a complex application that presents many interesting functionalities, including 2D and 3D graphics, audio and video support, maps, geolocation, augmented reality, speech recognition and synthesis, and even exchanging data via external services, and sharing data with social networks.
What you need for this book
This book presents a development of the game for the Windows Phone 8 platform. Thus, you need a set of tools that make it possible to create the game, test it, as well as run it on the emulator and the phone. Fortunately, the Windows Phone SDK 8.0, together with the Microsoft Visual Studio Express 2012 for Windows Phone as the Integrated Development Environment (IDE), should be sufficient at the beginning. A process of its installation is described in the first chapter of the book.
To use the IDE together with emulators, the computer has to run under the 64-bit Windows 8 operating system in Professional edition or greater, with the Hyper-V enabled. What is more, the processor has to support the hardware-assisted virtualization, the Second Level Address Translation (SLAT), as well as the hardware-based Data Execution Prevention (DEP). More details and other requirements are mentioned at http://msdn.microsoft.com/library/ff626524.
It is assumed that you will create the developer account, as well as register the Windows Phone 8 device. Such steps are mandatory to test the software on a real phone and to publish the solution. If you do not have the developer account, you will not be able to run the application on the phone and to submit it to the Windows Phone Store. However, you can still develop it in the IDE and run it on the emulator.
Who this book is for
This book is dedicated to beginners in the field of game development and the Windows Phone 8 platform, who want to learn how to create their first game!
No prior experience regarding 2D and 3D games development, the mobile platform, as well as XAML and Direct3D technologies, is necessary. However, some basic knowledge of object-oriented programming (OOP) (especially in case of C# and C++ languages) is required to understand parts of code described in the book.
The book content, together with the exemplary game, aims to present many interesting features of applications and games created for the Windows Phone 8 platform. However, to keep it simple, described examples may differ from best practices
, as well as may have limited security checks and functionalities. Before publishing your game, you should always test it precisely to ensure that it works correctly in normal, special, and erroneous scenarios.
Conventions
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: Every call of the Geolocator_StatusChanged method causes translation of the status into a text message and assigning it to the GeolocatorStatus property.
A block of code is set as follows:
public class PlayerData
{
public string Name { get; set; }
public GeoCoordinate Location { get; set; }
}
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
public class PlayerData
{
public string
Name
{ get; set; }
public
GeoCoordinate
Location { get; set; }
}
If a part of a code block is deleted to improve legibility, remove repetition, or simplify the content, the relevant parts are replaced with (…):
x:Class=SpaceAim3D.Views.MenuPage
(...)
FontFamily={StaticResource PhoneFontFamilyNormal}
(...)> (...)
phone:PhoneApplicationPage>
Any command-line input or output is written as follows:
ISETool.exe EnumerateDevices
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: Choose the Add and New Folder options from the context menu of the project in the Solution Explorer window.
Note
Warnings or important notes appear in a box like this.
Tip
Tips and tricks appear like this.
Reader feedback
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply send an e-mail to <feedback@packtpub.com>, and mention the book title via the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Customer support
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
Downloading the example code
You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
Errata
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
Piracy
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <copyright@packtpub.com> with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
Questions
You can contact us at <questions@packtpub.com> if you are having a problem with any aspect of the book, and we will do our best to address it.
Chapter 1. Getting Started
As mentioned in the preface, mobile phones are nowadays extremely popular, not only for communicating with people, but also to perform the role of powerful game environments with really outstanding functionalities. What is even more interesting is that you can create your own solutions for mobile devices that can be easily downloaded and used by people from various countries all over the world!
This is the first chapter of the book, which is prepared as a practical hands-on guide, presenting a step-by-step description on how to create a game for the Windows Phone 8 platform. However, it will not be just the simple game with a very limited functionality, because you will learn how to equip it with 2D and 3D graphics, audio and video support, maps, geolocation, augmented reality, speech recognition and synthesis, as well as integration with social networks, exchanging data via web services, and even more!
As you could see, there is a lot of content to get to know. However, at the beginning you should learn some basic information regarding the Windows Phone platform, and especially its newest version named Windows Phone 8, as well as the managed, native, and hybrid development approaches. Such subjects are presented in this chapter, together with an instruction on how to prepare the environment for developing the first game. Then, you will get to know the objective, rules, screens, and architecture of the game created as the example in the book.
Let's start the adventure with programming games for the Windows Phone 8 platform!
Windows Phone platform
The book is related to development of games for the Windows Phone. It is one of the existing mobile platforms, and is created by Microsoft. Its newest version (Windows Phone 8) was released in the last quarter of 2012. It works under the control of Windows Phone 8.0 OS that is different from Windows Phone 7.1 OS installed on Windows Phone 7.5 devices. However, on Windows Phone 8 devices you can also launch applications developed for the previous version of this operating system.
The Windows Phone platform introduces a new design of system and applications that is known as Modern UI. The main menu of the phone uses tiles (as in the following screenshot on the left) that perform the role of hyperlinks to various parts of the mobile environment, including applications and contacts. The user can easily select a set of operations that are frequently used and get access to them directly from the main menu. Tiles can present useful information, such as the number of incoming calls, unread text messages or e-mails. There are a few available sizes and types of tiles, thus you can adjust the main screen in a really comfortable way.
Since Windows Phone 7, the Marketplace (currently the Windows Phone Store) is chosen as a centralized place where users can browse, read details, and purchase or download applications. Therefore, the possibility of installing programs directly on the device, without a necessity of downloading them from the store, is restricted. Of course, developers can easily put their software directly on the developer unlocked devices to test it before publishing to the store.
The Windows Phone platform supports integration with many Internet sources, including social networks (such as Facebook and Windows Live), and e-mail accounts. These sources can be automatically updated, and data can be presented to the user in a comfortable way, for example, by informing about an incoming e-mail messages and using pictures from Facebook as images representing contacts in the phone.
The Windows Phone platform introduces some specific buttons, which make it possible to go back, show the main menu, and search data in various sources, including the Internet with the usage of Bing.
A design of the system can be adjusted by specifying the background type (dark or light), as well as an accent color that is visible in the main menu and application list. The newest Windows Phone version supports three screen resolutions—two in ratio 15:9 (480 x 800 and 768 x 1280 pixels) and one in 16:9 (720 x 1280 pixels).
As for the internal concepts, the Windows Phone 8 platform is similar to the Windows 8 operating system which is installed on desktops, notebooks, and tablets. One of the visible similarities is an existence of the Windows Phone Runtime that has many features common with its Windows 8 desktop version, named Windows Runtime. As mentioned at http://msdn.microsoft.com/library/jj681687, the Windows Phone Runtime provides the infrastructure and many features dedicated to the phone, including APIs for sensors and location. The Windows Phone Runtime is accessible from any programming model used while developing applications for this platform.
Managed, native, and hybrid development
Windows Phone 8 introduces a lot of new features that are useful not only for users, but
Recenzii
Recenzii
Ce cred oamenii despre Windows Phone 8 Game Development
00 evaluări / 0 recenzii