Pages

Categories

XNA Game Dev Blog #6

2011
05.18
XNA Game Dev Blog #6
Category: Uncategorized / Tags: no tag / Add Comment
Today I got round to adding explosions to the alien ships, as well as adding a semi upgrade to the ship. Other things done is the background shifting slightly with the player movement. Look pretty cool and a lot better than previously just having the background scroll along the Y axis.
My code is starting to get messy again, and I’m in desperate need to get it all organised again before I work on anything new. Everything up until today my code was reasonably manageable. Then when I added explosions, more code riddled into the main Game method for the creation of the animations when an alien ship is destroyed. Then when I added upgrades more functions came into the main game file with the collision checking, and setting new values of what the current upgrade the player has.
What I need to do is make a way for the player to call the add laser method by itself rather than the main game method, that way I can push most of the code onto the playership class. It would also help if I found a way to use the Draw method outside of the main game file too, however I’m not sure that’s possible. I’ll have to look into some examples on the App Hub Catalog and see how some of those projects do it. I wont be adding anything else until I sort my code out though, other wise I will seriously regret not doing it later on.
Here’s a video though of the current build:
https://www.youtube.com/watch?v=YsPKL-8RlQU
Once I do refactor my code however, I plan on doing a list of things:
• Add all upgrades (including the sprites that go on the playership visually)
• Add more aliens (different size, different health, perhaps ones that fire lasers back)
• Add a HUD of current health, scoring and general updates on the game (like what upgrade you picked up)
Later down the line, and probably the last thing I will do is create the menu screen, options, highscores etc.