XNA Creators Club Online
Page 1 of 1 (11 items)
Sort Posts: Previous Next

Helping to make the leap

Last post 1/24/2009 11:50 AM by Sean James. 10 replies.
  • 1/23/2009 8:43 PM

    Helping to make the leap

    I have a problem that's extremely frustrating. I realize people may not like answering "help a noob" questions, but please bear with me as I've been trying for a week or two to figure out where to go from here, and I have checked the FAQs and help section on the site. I feel like I'm stuck in between the gap of Novice and Intermediate XNA user. I can write code that keeps track of score, draw objects to the screen and control them with input, etc. I have an understanding of classes, incapsulation, inheritance and other programming concepts. The problem is, I don't really know how to implement them in terms of game design. For example, I'm not sure how to effectively use classes in terms of gaming and my simple games get so messy that I can't stand the sight of them. I've looked through the examples in the education section, but usually just get lost in the code and don't learn much from them. I'm asking for a kick start. Can anybody point me in the right direction, either to a good yet simple example of class implementation or tutorials of the like? I've been looking for them myself for quite a while now, but they're either way too novice to be useful, or they're too complex for me to understand. Please help me out of this rut!
  • 1/23/2009 8:47 PM In reply to

    Re: Helping to make the leap

    Classes are mainly used for things you need multiple instances of.  For instance lets say your making a PONG game, you could make a class called Paddle

    public class Paddle
    {
        Vector2 mLocation;
        Color mPaddleColor;
        int mPaddleScore;
    }

    obviously there would be properties and such.... but now, with that you can spawn two of these paddles, and draw then at thier individual locations, each bearing its own set of those members. I would also be glad to teach you things if you have AIM you can contact me at willthiswork89
  • 1/23/2009 8:53 PM In reply to

    Re: Helping to make the leap

    It doesn't matter what software field you happen to be in: Design is hard.  Just short of having someone mentor you or being a savant, the only way to get better at it is to study other systems and pieces of software.  Not necessarily for semantics but for why the game works (or doesn't work).

    You need to be reasonable with your expectations but that is a blessing not a curse.  Without the mentor or being a savant You'll make a lot of "ugly" things before making the first "beautiful" thing.  Expect your first serious stab at your game to be ugly.  Failure isn't that bad: Now you know what your game shouldn't look like.
  • 1/23/2009 8:56 PM In reply to

    Re: Helping to make the leap

    I agree with you tom, however if youve never seen beautifully written code, youll never know what beautiful is. If you were always surounded with ugly people, you would assume they are beautiful due to the fact that youve never seen a actual beautiful person :) (whos to say we all arnt) but still.
  • 1/23/2009 9:12 PM In reply to

    Re: Helping to make the leap

    I am in almost the same situation, but I think I have a few tips.

    If your code gets messy, you have probably not organized it in a smart way. Dont be afraid to use a lot of different classes, it's a good way to get much air in you code. Try also to group the classes in folders.
    Every class should take care of himself as much as possible. If you are sending the same information over and over again,  you are doing something wrong.
    Also try write as little code as possible in your base class (Game.cs), this will help you a lot when you searching for errors.

    You maybe heard this a thousand times, but oraginize the game first on paper will help a lot when you are coding.

    The programming, focus on one little thing at a time, make sure it works before you do the next.

    ----------
    Well, I hope it helped you a little. About the other things you have problems with: Can you be more specific? Dont be afraid to ask! What I know there is no good tutorails for us who are half-good, and that sucks.
  • 1/23/2009 9:22 PM In reply to

    Re: Helping to make the leap

    Tom Larsen acually has point, try to hang on to a project that some one else are making. You could also let someone take a look at your source code and ask for advice. There is a lot of people who is looking for a code partner (Im one of them), so Im sure it will work out fine!
  • 1/23/2009 9:47 PM In reply to

    Re: Helping to make the leap

    omegatheknight - Like the previous posters have said, there isn't an easy way to jump into making full-fledged games without a good amount of experience. However, a trick I used when I was first starting out(and even today when I'm doing things I've never done before), is to not think about your game in terms of classes and variables, but in terms of features and components.

    For instance, say you want to get a ship moving around on the screen. Don't let your first thought go immediately to what a ship class should have in it, but rather all of the things the ship will be able to do. If it can accelearate,brake, and shoot, then you can take each of those items and decide what will be necessary to make them happen. Now, from what you say, it sounds like you can already code functionailty like this, but the same principles can be applied to more complex tasks. 

    Making an asteroids game, might seem like a daunting task, but as you've already said, you understand classes, inheritance and encapsulation, so the next step is to use the method above to break down the seemingly complex task, of making an asteroids game into steps of:

    What Objects will be in the game?
    What are they able to do?
    What functionailty do they share?(inheritance)
    What controls are supported?
    What information needs to be displayed to the user?
    what type of game states need to be made available?(Start menu, difficulty select, game, death screen, credits, high score, etc)

    Each of these questions is a complex task in their own right, so applying the method above you can break down each complex problem into a simple one. Then you can easily research the problem at hand, and discover your solution. Don't be afraid to come to the forums if you don't have a solution, but try to break down the problem into as small a piece as possible.
    Joshua Foss  
    Programmer / Writer  
    XNA Documentation Team  
    Blog - Game Development Theory
  • 1/23/2009 10:26 PM In reply to

    Re: Helping to make the leap

    Don't overlook the importance of the initial design phase of the game (you know, before you start coding). You can save yourself a lot of trouble if you sit down and figure out all the objects your game needs, what functionality they may share, and how you want to impliment them. It's a lot easier to do it right from the get go than to go back later and try to clean it up.
  • 1/24/2009 3:30 AM In reply to

    Re: Helping to make the leap

    Wow. I didn't expect such a great response, XNA is really a great community. Thanks everyone for the advice, it is much appreciated. I definitely have a new way of looking at things and I think things should go much smoother. I just feel like there's a big wall in front of me at the moment. A little background: I'm about halfway through a computer science degree, which is where I learned all of the programming concepts through Java. Unfortunately, I've had little experience with the actual implementation of code. Game design is the only thing I could see myself enjoying as a career, and thanks everyone for helping me out. I will certainly be back for more help, most likely sooner than later, haha.
  • 1/24/2009 4:05 AM In reply to

    Re: Helping to make the leap

    By the way, it doesn't matter how good you are. Everybody has those days when you are totally stuck and nothing seems to work. (man! thank the Gods for internet)
  • 1/24/2009 11:50 AM In reply to

    Re: Helping to make the leap

    You may want to look through some of the tutorials on the site linked in my signature. I have a big long series on structuring a game/game engine. Even if you don't follow them all the way through, just looking over them might give you a nudge in the right direction.

    Hope this helps
Page 1 of 1 (11 items) Previous Next