developing games and applications for xbox 360 using xna* *xna is xna’s not acronymed an...
TRANSCRIPT
Developing games and applications for Xbox 360 using XNA*
*XNA is XNA’s Not Acronymed
An Introduction by Peter MessengerSenior Developer at QMASTOR
Newcastle Coders Group Presentation – 2nd August 2009
http://www.petermessenger.com
Developing Games Using XNA
• XNA is a set of tools that facilitates computer game development and management.– Simplifies Graphics, Audio, Input, Networking and Storage
• Can develop games for Windows, Xbox 360 and Zune– It attempts to promote code re-use across target platforms
• First preview Mar 2006, released Dec 2006– Version 2.0 Dec 2007, 3.0 Oct 2008. 3.1 Current
Why Use XNA?
• Could develop games in Flash, Silverlight/WPF or Iphone but…..– XNA technology built from the ground up to
• Enable code reuse and reduce repetitive development• Facilitate rapid and simple development for games
– Large user base• 30 million units sold• 20 million Xbox Live users• 26 Countries
– Tutorials for all aspects of development– Microsoft provide all the hosting and distribution
How I Learnt about XNA
• Saw a demonstration at Microsoft Tech Ed in September 2008– Interested as it was already using platform that I
was experienced with– Could see applications outside of game
development – simple training tools• Developed my first application in Mar 2009 – Based on exercise website for people with spinal
cord injury for Sydney Hospitals
Game Development
• XNA Game Studio 3.1 released March 2009• Runs as part of Visual Studio 2008 or free
Visual C# 2008 Express Edition• Based on NET Compact framework 2.0• Supports C#, LINQ• Downloadable from the XNA Creators Club
website• http://creators.xna.com
XNA Creators Club
• Download software, tutorials, forums and the like• Post your creations have them peer reviewed
and approved for Xbox Live.– Over 400 games developed to date.– Requires licence $US 99 per year for Xbox 360
distribution– Can sell games for 200, 400 or 800 points – developer
gets 70% of total revenue (about $2.30 - $9.20 per sale)
– Windows applications incur no licence fee
Developing Your GameApplication Consists of Methods• Initialization – Allows the game to perform any initialization it needs to before starting to run. This is
where it can query for any required services and load any non-graphic related content.
• Load Content– LoadContent will be called once per game and is the place to load all of your content
• Unload Content– UnloadContent will be called once per game and is the place to unload all content.
• Update– Allows game to run logic such as updating world, checking for collisions, gathering input
and playing audio
• Draw– This is called when the game should draw itself.
Developing Your Game
• Content such as XML, fonts, images, sounds and music get converted in binary XNB files– Requires writing code to encode/decode XML,
convert images into spritesheets etc– Examples of this can be found in tutorials on
creators club• While there is no “canvas” like in web
applications and Silverlight, there is many example code bases that get you started
Developing Your Game
• Can link into Xbox Live and network between users
• Use keyboard, mouse or controller• Interfaces for keyboard, game saving and
loading built in via GamerServices module• Can debug/publish on Windows/Xbox 360 much
like any other Visual Studio application• Once complete, Windows applications can be
distributed using Click Once technology via a website if desired
Using Xbox 360 for Applications
• Many issues make this difficult– Cannot network to outside servers– Lack of “standard” keyboard can make design
challenging – Limited interface for data entry• Many developers have built their own XNA open source
data entry frameworks to get around this.• Best example of this is xWinForms• http://sourceforge.net/projects/xwinforms/
Conclusion
• XNA is worthwhile investigating if you are a gaming enthusiast or want to be an independent developer
• Application development probably better handled using Silverlight/WPF – Very much depends on your business objectives– Silverlight likely to be available on Xbox 360 in the future
Questions and answers?