Observable Properties in XNA

I like to experiment a lot with XNA to try and find ways of doing things which I haven’t tried before.  Recently I have been doing some reading around the .NET Reactive Extensions and thought that it might be pretty useful to use something like that in an XNA game.  I played around with it a little bit and thought it was a little bit too “heavy” for what I wanted to do since it seems like I would need to define my observers as well as my observables. I was really looking for something that only required me to define my observable properties and subscribe to them using delegates without my other game engine classes needing to know anything about them.  By removing the knowledge of observers and observables from the other game engine classes it leaves the choice of whether or not to use a subscription-based approach open.

Imagine Cup Irish Finals 2011

On Wednesday and Thursday I was down at Microsoft Ireland in Dublin for the Imagine Cup Irish finals with the team I was mentoring from the University of Ulster Coleraine.  Unfortunately we didn’t make it into the top 5 but it was great for our team of first year students to get down and experience the whole event.

XNA Gestures Helper for Windows Phone 7

For my final year project at university I’ve been doing a bit of work with Windows Phone 7 and naturally that has involved working with gestures a bit.  I think the gesture support in XNA 4 is great but I found myself writing the same code over and over again to handle them.  So I decided to make a GestureHelper class which would take care of a lot of the repetitive work for me.  I’ve attached a sample project containing my gesture helper and a couple of examples of using it.

XNA IntermediateSerializer

Recently I’ve been doing a lot of XNA work which involves loading XML files via the content pipeline and I frequently found myself wanting to do more with the IntermediateSerializer than the basics.  I did a bit of a search and came up with the following blog article by Shawn Hargreaves that has helped me out loads:

Linear Interpolation Between Values in XNA

I thought that I would take some time to write up a quick article about using linear interpolation to smoothly transition between two values in XNA.  When I first found out how to do this it made a huge difference to the projects I work on.  Some examples of when I use this are for time based colour cycling and gradually modifying alpha values to fade out a texture over a defined period.  In general, I find that it is a simple method of adding some extra polish to any game.

Setting Alpha Value for SpriteBatch.Draw in XNA 4

A few weeks ago I spent some time upgrading my MicroStar Particle System from XNA 3.1 to XNA 4.  For the most part this process went smoothly; there were quite a few changes to be made all over the place.  However once I had cleared up all the build errors and ran the sample project I saw that my code for fading out particles when drawing them via my SpriteBatch instance was obviously not working.

Imagine Cup Team into Irish Finals

This year I’m mentoring a team at my university in the Imagine Cup; I don’t have the time to actually compete so this is a great way for me to stay involved with it.  On 04/03/2011 we received an email from Microsoft Ireland informing us that the team got through to the Irish Finals to compete for the opportunity to represent Ireland in the global competition.

Using the Bing Maps Silverlight Control

This week I played around with the Bing Maps Silverlight Control to find out how easy it would be to get a map up and running in an application, place pins on said map and get the name of the country that the user has clicked on.  I soon discovered that achieving this functionality was incredibly easy!

Generic Pool Class for Reusing Objects

When I am working with XNA, I frequently found myself writing the same code in order to maintain lists of objects in memory and track free items that can be reinitialized to reduce garbage collection.  Eventually I had enough of doing this and decided to implement a generic Pool class in C# that would take care of this for me.

Duplex WCF Services Over HTTP

I have recently been spending a lot of time working with WCF for my final year project which requires frequent and efficient communication between different types of devices including smartphones.  My initial approach was to occasionally and asynchronously poll the services to see if there was any new data available.  The problem with this is immediately obvious – constantly polling the server will impact the overall performance and will also drain the battery of any smartphone utilising the services so I began looking into duplex WCF services over HTTP.  I found it to be pretty easy to dig up some useful information on the subject and I must give credit to Frank Quednau for his “no frills, bare-bones example to Duplex WCF” article which served as the foundation to my own work.