Here's the problem: My character keeps wandering off the screen to the left and on top. It doesn't matter what I do. I've copied the code directly from Microsoft and still get nowhere. It seems it's an issue with the animation somehow, since I don't have this problem without the animation active.
I have two ways I can handle this:
- Figure out what's wrong with the animation and fix it. Dig into the numbers and break my brain against the desk until grey matter oozes out and I'm forced to start crying.
- Say "screw it" and insert some kludged code to fix the issue.
Right above my MathHelper.Clamp call, I tossed this in:
// Fix the "animation off the screen" problem temporarilyNo more off-screen character! Everyone is happy, although there may still be an underlying problem with this animation. Not sure yet, so it's just a temporary fix (that will probably become permanent knowing myself).
if (player.Position.X <= 50)
player.Position.X = 50;
if (player.Position.Y <= 50)
player.Position.Y = 50;
I've also done a few extra things: I was tired of not necessarily knowing when I had died. I decided to toss in a special scream when the character dies and an explosion over the top of the character. It's not pretty, but it's something.
I would like to have the ship move onto the screen to start, have several explosions in a row, and then vanish when the character dies. Not sure how to do that yet. I suspect I'll learn.
No comments:
Post a Comment