ZFGC

Resources => Coding => Topic started by: Theforeshadower on December 25, 2008, 05:51:52 pm

Title: Basic XNA 3.0 Walk-Engine and screen resize
Post by: Theforeshadower on December 25, 2008, 05:51:52 pm
Nothing outstanding.  Just messing and tinkering with XNA 3.
No collisions yet.  I'll probably put some bushes with bounding boxes or something on them.
You can just move Link.  No animations yet either.

Game1.cs is source code.
Title: Re: Basic XNA 3.0 Walk-Engine and screen resize
Post by: Cassyblanca on December 25, 2008, 10:44:03 pm
I'm sorry to say this, and I don't want to be offensive, but that is quite possibly one of the least efficient methods of handling this in XNA that I have seen thus far. Firstly, you aren't using object-oriented programming at all in this system, which completely defeats the purpose of using C# to begin with. You even avoided placing the X and Y coordinates of the sprite within a single two-dimensional Vector (Vector2), and instead passed a new object to it with every render call, which adds more work to what needs to be done within the Draw() method.

Next, your game logic is far from efficient, and (although, it is incredibly unlikely that this will be a problem in this example, with larger examples and games, it can become a problem) doesn't take the time delta into consideration at all. So, if your game lags, you are basically completely ignoring what should have happened during that time. Even your calls setting your X & Y coordinates could be better done as xxx += 1 and vvv += 1, rather than xxx = xxx + 1.

You have a good bit of work to do before this is anywhere near something that could truly be considered even a walking demo. I recommend you do a lot of reading and learning, and get used to object-oriented programming. As a matter of fact, my tutorial series at ZFGC University is going to be opening to the public (hopefully) by Monday. It covers creation of a Legend of Zelda game engine with XNA. You would have a good bit to gain from reading it.
Title: Re: Basic XNA 3.0 Walk-Engine and screen resize
Post by: Infinitus on December 25, 2008, 10:47:45 pm
Have to agree with MiN on that.

Also, two quick things. Comments please. And use a consistent naming convention on your variables. I mean, if you have a larger source file how is someone meant to know what the variables "vvv" and "yyy" mean :S.
Title: Re: Basic XNA 3.0 Walk-Engine and screen resize
Post by: Theforeshadower on December 26, 2008, 03:49:48 am
meh, I was just messing around.  I wasn't even going to use this for anything.
I was just using what I new from other languages and seeing what I could smash together.

LOL
Yeah, don't use that.

Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved