What can you code in 6 Weeks?

The Windows PhoneGreat Canadian Apportunity” Contest has been running since February 1st 2011. This contest is a Battle of Canadian Developers to make a Great Windows Phone 7 Application or Game.

160x600_WP7_TGAPP_banner_EN

If you didn’t know about this contest you have 6 weeks left to Register, Submit Your Idea, Develop your Application [Learning Resources], and Submit your App.

Here’s a little Secret

If you look at how the applications are being judged there is one section that not many applicants have picked up on, this is the part of Cloud Integration.

Around my blog you will find many Useful Resources for Windows Azure Development, if you want to get a jump in the competition with a minimal amount of lead time [remember there is only 6 weeks left] I would look to the cloud to bring your application into the forefront.

Getting Started with Windows Azure

To begin your application you can use the Windows Azure SDK & Tools to provide a local development environment by leveraging both the Compute Emulator and Storage Emulator. These two tools give you the ability to Develop and Test your Application with an Environment similar to the Windows Azure Production Platform.

Once you’ve got your application going and tested locally it’s time to take to the Cloud. To do this Microsoft has made available Windows Azure Pass Tokens which gives you a free month on Windows Azure without the need for a credit card.

Need to get a better understanding of how Windows Azure Works? Join me for AzureFest in Toronto & Mississauga on March 30th and 31st for more details on how to get setup for your venture in the cloud. Not in Toronto? Check out the Canadian Developer Connection Blog for more AzureFest dates near you.

Good Luck & Happy Clouding!

Windows Phone 7 Developer Briefings Tomorrow

syntaxc4-avatar-body

Have you heard? Windows Phone 7 is growing rapidly in popularity. Now is the time to pull out that Idea book that has been collecting dust over the past few years. Come out to Windows Phone 7 Developer Briefings and learn to write some application for a Market Place that isn’t littered with Fart Apps and Make your mark on the Windows Phone Platform.

Sl_v_rgb_rMark Arteaga from RedBit Development will be showing off the Silverlight Development Environment on the Phone. You’ll get a great overview of how to interact with the features programmatically.

xnalogoI will be covering the XNA Framework Development Environment on the Phone. Walking you through how to use XNA, Leverage Phone Features in your Game, and cover off some optimization techniques for games programming.

For more information on the Developer Briefing head over to the Canadian Developer Connection Blog.

How to fix the Alien Game Lab for Windows Phone

Alien Game on Windows Phone 7 built with XNATonight I went off to the very first Windows Phone 7 User Group meeting in Toronto, Ontario. There were a number of Rock Star presenters, including Joey DeVilla, Mark Arteaga, Anthony “The Mobile Situation” Bartolo, Mike Temporale; showing off the Features and Experience of the Phone, as well as a number of different apps.

While sitting in the Audience I worked away on a presentation that I’m going to be doing on XNA Game Programming on the Windows Phone. Which includes a demo of building a game, ensure the source code is provided in a timely fashion I opted to use the Alien Game Lab from Channel 9.

While running through the initial build of the game I noticed there were a few things which were slightly off in terms of how the game is supposed to function. Luckily it didn’t take much time to walk through the code and find the misbehaving code blocks.

Game Tombstoning

The “Back Button” is one of the three required hardware buttons on any Windows Phone 7 Device, it is required as it is supposed to provide a guaranteed User Experience that a User can rely on. The current download at the time of this blog post does not provide a good back button experience, in fact, the back button doesn’t do anything at all unless the current Game Session is Over (no lives remaining).

To handle this in accordance to the specifications as outlined in section 5.2.4 in the Windows Phone 7 Application Certification Requirements, add a Pause Menu to the Solution.

Opening a Pause Menu

The first option is to display the main menu which is Section 5.2.4 Stipulation ‘d’ which reads:

For games, when the Back button is pressed during gameplay, the game can choose to present a pause context menu or dialog or navigate the user to the prior menu screen. Pressing the Back button again while in a paused context menu or dialog closes the menu or dialog.

This can be achieved by modifying the MainMenuScreen.cs file, or how I did it, by introducing a new “Paused” Screen. The implementation is really up to you, this was just the simplest implementation without touching too much of the existing code.

if (input.PauseGame)
{
     if (gameOver == true)
           finishCurrentGame();
     else
          // Pull up another screen over the Game
          ScreenManager.AddScreen(new PausedScreen()); 
}

There will be a zip file of at the end of this entry where you will be able to download the final source for this solution.

Accelerometer Support

With the accelerometer being the only input device on the Phone for movement, it’s rather important for this functionality to be fixed in order to make the game entertaining. It seems like this application may have been ported to the Windows Phone, while maintaining the existing code which is supposed to allow Xbox Controller and Keyboard support for the Game. This feature could also be handled in two different ways in which I’ll only expand on one with code.

Compilation Symbols

The first article I had ever written on Development was a piece explaining Pre-processor Directives. These play a large role in multi-platform targeting [which is what XNA is all about]. Compilation symbols can be added to the Build Section of your Projects Properties, pairing compilation symbols with the #if directive allows the compiler to include only sections of code that are relevant for a particular platform that the code is being compiled against. Managing users input should be abstracted away from your logic as each platform has different input types and none of them are remotely similar [with the exception of the Zune and Windows Phone].

After Abstracting the input types into different classes you can surround the input handler creation with a pre-processor #if statement and have only the relevant code compile into your solution.

Remove Default Movement Assignment

After a little poking and prodding around the Accelerometer code I noticed that the Keyboard Support [which can be found after the Accelerometer Code Block] contained an if block, which had an else statement. This else statement was re-assigning the values for the movement variable which was set within the Accelerometer code. To get around this issue you can simply comment out [or remove] the else block.

//This section handles tank movement.  We only allow one "movement" action
//to occur at once so that touchpad devices don't get double hits.
KeyboardState keyState = Keyboard.GetState();

if (input.CurrentGamePadStates[0].DPad.Left == ButtonState.Pressed || keyState.IsKeyDown(Keys.Left))
{
    player.Velocity.X = -1.0f;
}
else if (input.CurrentGamePadStates[0].DPad.Right == ButtonState.Pressed || keyState.IsKeyDown(Keys.Right))
{
    player.Velocity.X = 1.0f;
}
//else
//{
//player.Velocity.X = MathHelper.Min(input.CurrentGamePadStates[0].ThumbSticks.Left.X * 2.0f, 1.0f);
//}

Obviously this is a work around solution for the phone, if you plan on supporting all 3 platforms, I would suggest spending a little bit more time on this ensuring that this doesn’t break functionality in the Windows or Xbox Versions.

Conclusion

I know how hard it is as a developer to stop yourself from jumping directly into the code, but there is a lot to keep in mind when building a game, especially when there are requirements set for User Experience in order to publish your game on a device.

My biggest piece of advice is to read the Application Certification Requirements for Windows Phone 7 before you even prototype your game, and yes, you will want to Prototype your game.

Shameless Self-Promotion

If you’re in the Toronto area please come out to see my talk on December 2nd in Mississauga or December 9th in Toronto. For more information please see the Canadian Developer Connection Blog Entry.

Download The Updated Alien Game Lab Solution

Polymorphic Podcast for Windows Phone 7 is Live!

The first Iteration of the Polymorphic Podcast Application for Windows Phone 7 is now available in the Zune Marketplace! You can Download the Polymorphic Podcast Application for Windows Phone 7 by clicking on the metro download image below.

Click Here to Download the Polymorphic Podcast App for Windows Phone 7

You will need to Download the Zune Software in order to view the Marketplace listing, or to install the application to your phone. After accepting the security message you will be redirected to the application in the Zune Software. You will be pleasantly surprised to see that the Application is *FREE*

image

Special Thanks to Craig Shoemaker [@CraigShoemaker] for creating the Podcast and Approving my Idea!

Enjoy!

Polymorphic Podcast–Market Place Testing

Only a few weeks ago I let the cat out of the bag that I was building a Polymorphic Podcast Streaming App for Windows Phone 7. I couldn’t believe how quickly the Application came together, with a POC put together in only 2 hours.

This is a fairly simple application built in Silverlight with VS2010 and Expression Blend and a touch of XNA. A good friend of mine Barranger Ridler [@4MKMobile], blogged a great write up on how to use the XNA Framework to Stream Audio on Windows Phone 7 which definitely sped up the development process.

After an extensive wait, I finally made it through the GeoTrust Audit and got on the whitelist to upload my application to the Market Place for Testing. I’d have to say, for only skimming over the Application Certification Requirements [Hey, I was *really* busy] the first application certification test went very well with only 2 fails.

Fail #1

4.6 Application Screenshots

For each application, you must provide at least one or up to a maximum of eight screenshots. The users see this screenshot in the details page of the catalogue before they make a purchase. The screenshot should be a direct capture of the phone screen or emulator. Graphically-enhanced screenshots are not allowed. The following table lists the size and file type requirements for application screenshots.

Yeah, this one was my fault, I left the emulator borders on the screen shots. Oops!

Fail #2

6.5 Applications that Play Music

When the user is already playing music on the phone when the application is launched, the application must not pause, resume, or stop the active music in the phone MediaQueue by calling the Microsoft.Xna.Framework.Media.MediaPlayer class.

The application needs to prompt the user for consent to adjust the volume or stop the music that is currently playing in the Zune queue.

This is the reason why it is important to read the documentation [carefully]. This actually was a very simple fix, as the phone uses the XNA Framework for the on board Zune Support. All I had to do was wrap the “Play”, “Pause” and “Stop” buttons with a helper method to ensure nothing was playing before performing the requested action.

About the Fails

The Test team is actually really nice about how your application fails. They provide the Steps to reproduce their testing along with a descriptive message as to why your application failed.

I hope they keep this trend up as it definitely helped pin-point the problems with your application so you can fix it up and resubmit it quickly.

Polymorphic Podcast App for Windows Phone 7 Screens

Dark-Screen

Light-Screen

Splash-Screen

I Can Totally Pimp Your Phone, Girlfriend

With the Launch of Windows Phone 7 coming on Monday [Monday November 8th, 2010], you may ore may not have been thinking about making the switch. I’m here to tell you that if you’re interested in moving over to the platform and it’s missing that application that you care so near and dear about, that I can write applications for the Windows Phone 7 [See my first App: Polymorphic Podcast].

I Have Totally Pimped Your Phone, Girlfirend!

If you have an idea for an app that you don’t have time to build or you don’t know how to build applications at all, I am interested in hearing your ideas! Please leave a comment below, or contact me and we can discuss how to bring your application to the Windows Phone 7 Platform!