To build Pumpkin Defense, we'll open up the solution located inside the proj.wp8-xaml
folder in the source bundle, since proj.wp8
will be deprecated soon.
Once we have imported the project, the
Solution Explorer shows you the various other projects that pumpkindefense
depends on. This is quite similar to the win32 builds we've been following throughout the book.
However, one important difference here is that along with the pumpkindefense
project, there is another project titled pumpkindefenseComponent
. If you look closely, you will notice that pumpkindefense
is a C# project and it is used to provide the primary application framework for a Windows Phone 8 project. The pumpkindefenseComponent
project is a C++ project that contains all the source files for our project.
If you expand the Classes
folder inside pumpkindefenseComponent
, you will notice that the actual sources are missing. So, delete the default class files listed there and then right-click on the Classes
folder, select Add, and select Existing Item....
In the window that follows, select all the source files for Pumpkin Defense and add them to the Classes
folder inside pumpkindenfenseComponent
.
Now that we have our classes in place, all we need to do is click on that little green arrow and run the project.
A few customizations for audio and fonts are required while building for Windows Phone 8. Windows Phone 8 does not support MP3 audio files, so ensure that all your audio files are converted to WAV. You could use Audacity (http://sourceforge.net/projects/audacity/), which is an open source utility to convert your audio.
With regard to fonts, you only need to worry if you're using true type fonts or TTF labels in your code. If so, you must check the list of supported fonts (http://msdn.microsoft.com/en-us/library/windowsphone/develop/cc189010(v=vs.105).aspx#silverlight_fonts). If your font is not in that list, you must include the .ttf
file for the respective font in the resource bundle for the given project.
3.137.183.10