Pages

Categories

XNA Game Dev Blog #7

2011
05.19
XNA Game Dev Blog #7
Category: Uncategorized / Tags: no tag / Add Comment
As I expected, I didn’t get round to do ANY coding today. However it has been a rather educational day for me. From yesterday I talked about how my code is getting a complete mess, and that I should refactor it, so I’ve been looking at a few sources today. 1 Website I was reading through was the MSDN library on XNA Framework Class Library. When I first saw this just shy of 2 weeks ago, I had nearly no idea what was going on. Looking back on my moving car, I was just guessing what methods to use based on looking at other peoples code and reading a few tutorials. The MSDN was just loads of jibberish, and that all I ever used it for was to see if I’m using a method right. So today I started looking through the XNA framework, and lots of it made sense since I’ve played around with most of the methods in SpaceShooter. I also came across this blog post, where they have created class diagram images of the XNA framework, very handy to flick through and see how everything is interlinked.
The second main source I was looking at was the source code of Net Rumble from the App Hub catalog. I chose Net Rumble to look at because it has distinct features that are similar to my game. Both have ships, move around, lasers/projectiles with upgrades, and collision. What I learned from Net Rumble, after looking at how the game works (which I’m still looking into), is that parts of the code have their own Draw calls, and LoadContent, something I thought that could only be done from the main game file, and how XNA games progressively loaded content such as the next level was some form of black magic. After cross referencing how Net Rumble is written, and looking back at the MSDN library, it’s all starting to make sense how they did it.
So today, I’m starting to learn how the XNA framework works, and how to take advantage of it all, (if not all then some of it). Also that class diagrams are brilliant to see how code is structured.
As for content for today, is my class diagram of my SpaceShooter:

As you can see, not very clear to understand what’s going on. It also shows just how bad the Game1 class is getting. It may be a while before my next blog post, but hopefully it will be about finishing the code refactoring.