Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Basic XNA 3.0 Walk-Engine and screen resize  (Read 1066 times)

0 Members and 1 Guest are viewing this topic.
Basic XNA 3.0 Walk-Engine and screen resize
« on: December 25, 2008, 05:51:52 pm »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
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.
Logged
  • Super Fan Gamers!
Re: Basic XNA 3.0 Walk-Engine and screen resize
« Reply #1 on: December 25, 2008, 10:44:03 pm »
  • Minalien
  • *
  • Reputation: +10/-1
  • Offline Offline
  • Gender: Female
  • Posts: 2119
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.
Logged
Quote
There's such a double standard about religion in the modern world. Catholics can gather, wear white robes, and say "In nomine Patris, et Filii, et Spiritus Sancti" and be considered normal.

But if my friends and I gather, wear black robes, and say  "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn", we're considered cultists.
  • Development Blog
Re: Basic XNA 3.0 Walk-Engine and screen resize
« Reply #2 on: December 25, 2008, 10:47:45 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
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.
Logged
Re: Basic XNA 3.0 Walk-Engine and screen resize
« Reply #3 on: December 26, 2008, 03:49:48 am »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
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.
Logged
  • Super Fan Gamers!
Pages: [1]   Go Up

 


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



Page created in 0.152 seconds with 45 queries.