Friday, March 4, 2011

XNA game design for Windows Phone 7

Introduction

I just downloaded the XNA SDK to try making a game for Windows Phone 7.

Although there are many lab games that have reusable logic, I found it hard to understand some of the design decisions. For the time being, I'll be doing everything from the ground up and rather letting myself be inspired by the labs and other people's example code online.

Game screens

This will be a puzzle game, like a Sudoku. I'll need the following game screens:

  • Background (this one will always be drawn, but never not accepting input)
  • Gameplay screen (active when playing, accepts input)
  • Menu screen (accepts input)
  • Pause screen (popup over gameplay screen that can accept input)
  • Other popups, like highscore displays

Development plan

  • (In progress) Write basic screen management system
    There are plenty of labs and other tutorials online with ways to do this. The idea of the screen manager is to maintain a stack of screens, for example: Background, Gameplay, Pause screen. Each screen has properties like IsPopup, CanAcceptsInput, Visible, IsCoveredByPopup and these properties are used to make sure objects are drawn in order and screens only update when it is required.
  • (Completed) Animating background
    It may seem a bit odd that I started with this already. I found a scrolling starry night background on MSDN that works well with minimal implementation efforts.
    With an animating background I will, from the beginning, know that the game is not getting stuck and that resources are being loaded correctly (an asset is used for the starry night background)

0 comments:

Post a Comment