XNA Creators Club Online
Page 1 of 2 (49 items) 1 2 Next >
Sort Posts: Previous Next

Beginner - Intermediate Tutorials

Last post 05-22-2008 5:20 PM by XNAtticus. 48 replies.
  • 10-12-2007 1:34 PM

    Beginner - Intermediate Tutorials

    Hello, I'm working on a college grant using XNA and teaching to younger students using tutorials which I've written.  I've written these in the last 2-3 weeks and are pretty basic but I'm finally getting to some better and more interesting things for any beginner to intermediate XNA programmer (Tutorial 3+ will be more intermediate).  (Note: Some C# knowledge is required)  Please take a look at the following and let me know what you think (these are constantly being updated when errors are found and I should be back here a few more times with some new tutorials for you all).

    Full Tutorial List (Updated Nov 30, 2007):

    Have a 1.0 refresh XNA project you want converted into 2.0 (Beta)? Use this article to convert your project easily.

    XNA Development: Tutorial 1 - Installing Visual Studio C# Express Edition, installing XNA Game Studio Express 2.0 (Beta) and its templates.

    XNA Development: Tutorial 2 - Creating your first project and understanding what is created in the new project; also a secondary introduction to the development environment.

    XNA Development: Tutorial 3 - Writing and implementing a GameModel class used to place and render models within your scene.  Get the house model files for this tutorial HERE.

    XNA Development: Tutorial 4 - Make a very basic GameCamera class that allows you to move through a 3D world utilizing forward and back movement, strafe left, strafe right, and turning left and right (sorry no up and down!).

    XNA Development: Tutorial 5 - The GameSprite class will bring that much needed flare to your project, adding 2D HUD elements such as a rotating map and health box.  Get the HUD files for this tutorial HERE.

    XNA Development: Tutorial 6 - Using the GameState class will both clean up your code and provide different game states such as InGame and Pause.

    XNA Development: Tutorial 7 - The GameAudio class will make your demo sound just as awesome as it looks!

    Otherwise you can find all the tutorials HERE.  Any feedback is welcome, thanks!

    A bit about me: I am a student pursuing my bachelor's degree in Applied Mathematics and Computer Science.  I currently have an associate's degree in Computer Programming.  Games have been a part of my life since age 5 when I started playing them and started programming them in late high school where I created my first game (a really choppy RPG) in Visual Basic 6 in my first ever programming class.  You can find more on me at my site (or on my resume).
    =========================
    Blog

    Projects
  • 10-16-2007 10:39 AM In reply to

    Re: Beginner - Intermediate Tutorials

    Well from what I can see they appear to be well structured. I must admit I havent gone through them with a fine toothcomb but from what I did read it was good.

    They may be basic but they are reasonably clear and easy to follow. One trivial thing I would note is that in document 3 you list a Render() function then move onto explain it. I think it may be easier to follow if you quote each line or couple of lines before talking about them as you tend to keep having to scroll back to the page above to see what it is your discussing.

    Otherwise, good start and I like the "problems" section at the end (maybe rename this though? Exercises?) - nice to make people think a little more than just typing out lines of code.
  • 10-16-2007 11:11 AM In reply to

    Re: Beginner - Intermediate Tutorials

    I love the layout. Very clear and clean. Nicely done and I hope you keep it up. Thanks for sharing and giving a little to the community! Looking forward to see more in the future.
  • 10-18-2007 11:54 AM In reply to

    Re: Beginner - Intermediate Tutorials

    Thanks for the feedback guys.  I've taking into account what you've said and changed tutorial 3 to be easier to read without going back.  I also changed the 'Suggested Problems' and have added the second link into tutorial 3.  I've just finished coding up a really basic camera class that supports movement and turn (no up down movement yet) and I should be starting to write that one soon.
    =========================
    Blog

    Projects
  • 10-18-2007 8:18 PM In reply to

    Re: Beginner - Intermediate Tutorials

    XNAtticus I have to prepare a presentation about XNA (pure introduction) and right now I am planning the layout.
    I think, that I will follow your example about nice and clean, step by step introduction to this (and not theories, pros and cons about XNA only).

    Keep programming.
    Aggelos
    Microsoft MVP(XNA), Microsoft Student Partner Athens, Greece
  • 10-24-2007 3:16 PM In reply to

    Re: Beginner - Intermediate Tutorials

    im trying your tut num3, and the render code gives me errors.

    Error 2 The name 'view' does not exist in the current context C:\Documents and Settings\Admin\My Documents\Visual Studio 2005\Projects\WindowsGame1\WindowsGame1\GameModel.cs 57 13 WindowsGame1

    Error 1 The name 'projection' does not exist in the current context C:\Documents and Settings\Admin\My Documents\Visual Studio 2005\Projects\WindowsGame1\WindowsGame1\GameModel.cs 55 13 WindowsGame1

  • 10-24-2007 5:46 PM In reply to

    Re: Beginner - Intermediate Tutorials

    Good question!  It's my fault, I forgot to have you add two global class variables (something I've addressed differently in Tutorial 4 that's being worked on).

    Up towards the top where you've got:

    //Class model storage
    private Model gModel;

    //Aspect Ratio
    private float aspectRatio = 0.0f;

    //Position of our model
    private Vector3 positionVector;

    Add the following just below it:

    private Matrix projection;
    private Matrix view;

    Let me know if that fixes it, I'll make sure to append this to the tutorial tonight and get that updated version up later tonight.

    That sounds awesome grnemo!  If you find anyone interested with XNA make sure to suggest this site and forums (and even my tutorials if you want!).
    =========================
    Blog

    Projects
  • 10-26-2007 8:29 AM In reply to

    Re: Beginner - Intermediate Tutorials

    Ah, yeh thank you. it works :P but how would i change where the 3d model is stored, as i want mine in "Content\Model\ModelName"

    would it be

    myHouse = new GameModel(content, graphics, "Content\\Models\\ModelNameHere");

    Maybe?

  • 10-26-2007 11:53 AM In reply to

    Re: Beginner - Intermediate Tutorials

    That's exactly it.  It's easy if you just add the folders inside your project in the Solution Explorer and move your model right in there within your project.  BUT!  Make sure all the texture images and such are also placed in that folder otherwise you'll receive a wierd compiler error saying it can't find whatever the texture file is named (XNA links models and that during build instead of while it's running).

    In the tutorials I have posted I really only use one type of file, the model files.  I've finished tutorial 4 and will post it when it's edited and ready.  But, Tutorial 5 will introduce a new type of file (sprites) and I'll start off with placing all my content in folder structures like you've asked about.  Good question and you'll see a more official version when tutorial 5 is up.
    =========================
    Blog

    Projects
  • 11-05-2007 11:23 PM In reply to

    Re: Beginner - Intermediate Tutorials

    Boy, it sure has been quiet around here lately.  Let's liven things up a bit:

    XNA Development: Tutorial 4

    Tutorial 4 focuses on the GameCamera class, a basic forward, back, left strafe, right strafe, left turn, right turn, camera class.  Also included is a small primer on linear algebra (used in the camera class).

    UPDATE: I've changed the post so I'll post all the tutorials I have done in the first post as I finish them so I don't have to keep double-triple posting.  Notice, Tutorial 4 and Tutorial 5 have been added.
    =========================
    Blog

    Projects
  • 01-14-2008 2:12 AM In reply to

    Re: Beginner - Intermediate Tutorials

    Great tutorials! I've learned more from these than any other resource so far. I'm at the end of Tut #4 and I'm getting an error:

    "No overload for method 'Render' takes '0' arguments"

    and references: "myHouse.Render();" in game1.cs.

     

    I'm not sure how to resolve this error. Any help would be GREAT!

    Thanks again for sharing these wonderful tutorials, they're a real life saver!

    The Spice Must Flow.
  • 01-14-2008 10:57 AM In reply to

    Re: Beginner - Intermediate Tutorials

    That line should read:

    myHouse.Render(camera.GetViewMatrix(), camera.GetProjectionMatrix());

    Check out page 11 of Tut 4 for that line.  I hope this helps, keep me posted on if you get that fixed or not.

    Quick update, I've been on winter break from school for the last month approximately and haven't worked on the Tutorials since but don't worry, I head back to school next week and should be able to get more tutorials out.  (Maybe I mentioned this but I've got 5 more tutorials planned in this series).  I'm working on a game for my portfolio currently but what I've done in it really helps me write these tutorials since I can see if they're practical to use in a game scenario.  I'll take the next week to work on the game and get back to the tutorials next week.
    =========================
    Blog

    Projects
  • 01-14-2008 11:15 AM In reply to