XNA Essentials

Game Programming for Xbox 360, PC + Windows Phone


Zune HD Scribble Test – Source Code

I did a talk yesterday at the Raleigh Code Camp. It went well I think. If anyone was at the talk and would like to give me feedback, feel free. The only way I’ll get better is if I know how effective / non effective the talk was.

It is always interesting trying to give a talk to an audience with people who have no clue what XNA is as well as those who have been fooling with it for a year or more. Ultimately, there are parts where both parties are bored – but hopefully not at the same time!

Anyway, while the talk was more about best practices for XBLIG and what you need to do to submit games to ultimately make money using XNA, we did spend the last 10-15 minutes of the session looking at a scribble app I made for the Zune HD on Friday night before the session.

Rob Zelt mentioned on twitter that I may have very well been the first person to do an XNA talk with a demo for the Zune HD at a Code Camp. Seeing how the Zune HD was just released this past week and typically Code Camps are held on Saturdays and I had the second session of the day at 9:40 EST I think he may be right. For some reason that makes me smile. A geeky gold star for me.

OK, now to the actual project. You can download the project and look at the comments to see what it is doing. I also did a brief video on it Friday night after I got it working.

At a high level, the code is simply looking at the touch panel collection to see all of the points / vector2 that were moved. It grabs the starting and ending point for this move and adds it to a list. We then draw a line from the starting point to the ending point and do that for each line segment in our line list. To erase it, we just shake the device. Really, we are just checking the difference of the acceleration on the X or Y axis to see if it has moved a certain amount in a frame. This way if someone just moves it slowly or turns it the screen won’t erase, but if it is a fast enough motion (easily produced by shaking) then we clear the line list so there is nothing to draw. The demo code also collects the rotation of the device from the accelerometer as well as the acceleration, but doesn’t actually use the rotation values.

Hopefully this will give you an idea of what is needed, but you should definitely check out the documentation from XNA Game Studio. In order to run this, you will need a Zune HD as well as the latest XNA Framework which comes in XNA Game Studio 3.1 Zune Extensions.

Download Zune HD Scribble Test

Happy Coding!


Raleigh Code Camp 2009 – 9/19/09

If you are within driving distance of Raleigh, North Carolina you should really take the time to come to the code camp this Saturday, September 19th, 2009. There will be some excellent sessions like:

  • Building Composite Applications with Silverlight 3 and Prism
  • Unit Testing with NUnit and Watin
  • Lucene: Search We Can Believe In!
  • ASP.NET 4.0
  • jQuery from the Ground Up
  • Measuring and Improving the Performance of your .NET Applications
  • Get Rich with UX in Silverlight
  • Implementing ADO.NET Data Services
  • Making Money by Making Games with XNA [by yours truly]
  • Ignite Your ASP.NET MVC Project with Spark View Engine
  • Dynamic Language Performance
  • Parameterized Unit Testing with Pex : Automated White Box Testing for .NET
  • Blend for Developers
  • Bootstrapping for Fun and (Hopefully) Profit
  • Beginning Windows Mobile Development
  • PHP on Windows
  • SQL Server 2008 Reporting Services for .NET Developers
  • NIS Re-engineering of the Data Framework via Object Relational Mapping tools with Domain Driven Design Methods [Say that 3 times fast!]
  • Building Business Applications in Silverlight 3
  • Bigger, Stronger, Faster – Making Quality .NET Applications Fast and Bug Free
  • Database Design for Developers
  • Building a Blog with ASP.NET MVC
  • Ruby for C# / .NET Developers
  • Introduction to the AutoCAD API
  • Building Composite WPF Applications
  • SQL Injection
  • The Ins and Outs of CloudDB
  • Visualizing Change using TFS 2020
  • Team Documentation with OneNote
  • Templating and Data Binding in Expression Blend
  • Practical Test Driven Development with Visual Studio Team System
  • MVC and the Repository Pattern
  • Developing WPF Applications with Prism
  • Delegates, Lambdas, and Expressions (Oh My!)


Besides all of those sessions (plus at least one more that hasn’t been announced), there are also giveaways.  Who doesn’t love free stuff?

So there are plenty of opportunities to learn new things and to see if there is something you would like to spend more time doing.

Also, I may devote some of the time of my talk on the new Zune HD assuming someone has one at the code camp. Mine won’t arrive until next week it seems.

The event is free and there are plenty of things to learn, so don’t let this opportunity pass you by – get to Raleigh this Saturday.

When: Saturday September 19, 2009 8:00 AM – 5:00 PM
Where: ECPI - 4101 Doie Cope Rd Raleigh, NC 27613 [Bing it!]
How much? $0 – as in free, nada, zip, zilch, zero.



And as a heads up … on October 10th, Charlotte, NC will be having a Mega Code Camp. I’ll put up a post about it as the date draws closer, but mark your calendars now for that event. I hear there will be a lot of labs to really get hands on with  the sessions.

Happy Learning!


Microsoft MVP Awarded July 1st

I’m pretty late to be announcing this. I can’t believe it has already been two months since I’ve received the award, but on July 1st, 2009 I received the Microsoft MVP Award in the area of XNA/DirectX.

MVP_Horizontal_FullColorI’m honored to have been awarded this. The main reason why someone is given the MVP award (less than 5,000 world wide currently have this award) is because of the work they do in their community.

Speaking in User Groups and Code Camps are the types of things that help someone get the award. Helping out with the local user group is a big plus. Even doing things like making sure the venue facilities are returned back to the way the group found them can be helpful. Finding a good place to meet monthly is challenging. The last thing the group wants to do is lose their facility. My local .NET User Group currently meets at Advanced Home Care, which is a great location. We meet the first Tuesday of every month. We will be meeting tonight, September 1st at 6:00PM. If you are near Greensboro definitely drop by. The great thing about User Groups and Code Camps is that they are absolutely FREE to attend. Yes, the folks that give their time to run the user groups and organize the code camps find sponsors who pay for the food, swag and everything else that goes into putting on these events.

Besides being active in my local user group and speaking there, I’ve spoken at a few other places including Burton Center for Arts & Technology near my hometown of Roanoke, VA. I gave three lectures one day to some middle schoolers and some high schoolers. It was an enjoyable day and the students seemed to enjoy the fact that games could be written for the Xbox 360 console.

Several years ago, I spent a lot of time in SecondLife. I created a few games in there and used to sell them. There is a .NET User Group in SecondLife where I’ve gave an XNA talk earlier this year.

While the PDC event was taking place last year, Chris Love, Rachel Appel  (who are both MVPs themselves) and a few others started up NotAtPDC. I was able to give an XNA talk using LiveMeeting. Giving talks online is definitely challenging because you can’t see the audience. You have no idea if you are connecting with them or not. Either way, I’ve enjoyed both and will probably do these types of events again.

Since you are on this site, you most likely know I’ve written a book on XNA game programming using XNA Game Studio. This also played a big part in me getting the MVP award I’m sure. There are some that think getting the award because you wrote a book is cheating because you already got compensated for the book. Typically (and my book is no exception) technical books do not bring the authors much money. But it can be argued that any money is still compensation and community work has no monetary rewards. Some don’t see any difference in putting time into a book that helps others, versus time into a website with Ads. Sometimes ads have made more money for folks than royalties from a technical book. Others tend to think that if work was done and you can be awarded for it multiple times then more power to you. That said, having the book alone wouldn’t have been enough. In fact, this was my second book. So having two books alone wouldn’t have been enough to be awarded with the MVP Award. It was the activity with the local user group and code camps and the speaking engagements.

On a side note, I found out last week that a college professor of mine (who taught several of my Computer Science courses including Graphics Programming) is using my Microsoft XNA Game Studio 3.0 Unleashed book this year for that class. There are other colleges and universities that use my book in different courses, but to have your old college professor use your book to teach a class he taught you is pretty surreal.

So here is the call to action for you my dear readers – yes both of you – you need to get plugged into some community activity. A great way to become a better developer is to surround yourself with better developers. A good way to do that is to attend user groups and code camps. Of course the other events like PDC, Mix, GDC and GameFest are good too – but there is usually travel costs plus the actual event cost which can make it prohibitive for some. With user groups and code camps which are free for the attendees there is no reason not to get out there and meet other developers and learn new things.

Happy Networking and Learning!


Raleigh Code Camp – September 19th, 2009

If you are near the Raleigh, NC area on September 19th, 2009 you should really drop by the free Code Camp. If you have never been to a code camp, it is an event put on by a local user group. The events are free to the folks that attend. The folks that give their time to run the user groups and organize the code camps find sponsors who pay for the food, swag and everything else that goes into putting on these events.

If you aren’t in this area, you should definitely check around to see if there is a .NET User Group in your area. I attend one locally here in Greensboro, NC where we meet the first Tuesday of every month. We will be meeting tomorrow night, September 1st at the usual place.  The talk tomorrow night is on “Mashing up MVC, Bing, Maps and Flickr”. It should be good.

Again, it is really beneficial to get plugged into your local developer community. What better way than through events like User Groups and Code Camps?

The session list for the Raleigh Code Camp promises to have some excellent content. If you are interested in XNA you can hear me talk, but there are tons of other subjects that are interesting as well. There are talks on jQuery by Rachel Appel and Kevin Griffin, Database Design by Andy Leonard, Blend for Developers by Diane Wilson, LOB Apps with Silverlight 3 with Jim Duffy, general guidance on making high quality .NET applications with Chris Love, TDD with Steve Andrews, Dynamic Language Performance with Kevin Hazzard, UX in Silverlight with Rob Zelt and many others. The quality of speakers for this event is really great. I’m privileged to be speaking at the same event as these folks.

Again, to better ourselves as Software Engineers it is crucial for us to continue to learn. A great way to do that is to get with like minded people and User Groups and Code Camps provide an extremely cheap (FREE) way for us to connect with others.

Happy Networking and Learning!