XNA or Silverlight for Windows Phone 7 game

來源:互聯網
上載者:User

Since XNA and Silverlight are both supported on Windows Phone 7, a common question is which makes more sense for developing games. The definitive answer is “it depends”

Both technologies have their benefits and it would be great if we could eventually get to the point where you could combine the graphics capabilities of both in the same application and use the best tool for the job. Now I haven’t delved too deep into the changes in XNA for Windows Phone so I’ll be going mostly off of what I’ve experienced with game development on XNA in the past.

Generally writing a game will be easier in XNA since XNA was built from the ground up to be a game framework. Many of the decisions made when architecting XNA also make it a non-ideal platform for developing many other types of apps besides games.

The most notable architectural difference is the idea of a visual tree versus drawing everything every frame. In Silverlight for something to be displayed it needs to be added as the child of some other element. In XNA, everything is drawn every frame. If you don’t explicitly draw something it won’t show up. Which one of these is better depends on your game, but if there is a lot of action the XNA “immediate mode” type rendering will probably be the better choice.

Let’s take a look at some benefits of each (I’m sure there are more on both sides):

XNA Benefits

  • Great support for 3D
  • Superior performance when many elements moving or being added/removed
  • Built in game loop
  • XNA’s polling based input generally a better fit than Silverlight’s event based input for games
  • XNA content pipeline makes handling large stores of content easier
  • More image formats supported
  • Can make game for both Xbox and Phone
  • Graphics blend modes (Silverlight only has alpha blending)
  • More GPU acceleration built in
  • Lighter memory footprint for bitmap based games
  • Superior shader support
  • Drawing with a “tint” easier

Silverlight Benefits

  • Vector graphics (XNA has some very basic line drawing support)
  • Vector drawing of text (XNA text is bitmap based)
  • Can make game for phone and web
  • Storyboard animations
  • Visual states and behaviors
  • Navigation framework
  • Controls (button, listbox, user controls, etc)
  • Expression Blend design support
  • Event based model is more familiar to many developers
  • Data binding can come in handy in some scenarios
  • VisualTreeHelper useful for determining what element is being touched

So if you have a game that’s vector graphics based, or relies on things like buttons and other GUI elements you probably want to choose Silverlight for your game development. If you’re doing a 3D game or a 2D game with a lot of motion or particle effects choose XNA. If you’re somewhere in between you may want to pick whatever you’re most familiar with, or it may depend on whether you also want to make the game available on Xbox or web.

It’s great that both options are available and you have the choice of which to use.

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.