XNA Tutorials Pack 5
I felt talkative today, so this collection is almost two hours long. I’m not sure I’m actually giving that much more real information compared to when I try to be concise. Sorry… (c:
There is still a download page, which will be integrated into the new layout, whenever I get that done. My parents showed up early for the Christmas gathering, so there has been some sightseeing and a lot of catching up to do this last week. Fun, fun!
XNA Practice - This time, we make an Image class, so we get a real-code example of how you can encapsulate functionality. In order to show that encapsulation is good, we then use the Image class in a new Mouse class, to draw a mouse cursor on screen.
C# Theory - Doing all this mostly show practically how to use some of the concepts we’ve already been through, so the only new concept introduced is Properties. However, the last video answers a few design questions, based on feedback.
The packs will have more and more practice videos as we get farther along.
Beta 1 Viewers
Some of you were watching this series in its first incarnation, during XNA beta 1. I’ve tried to provide some new things, not introduced in those videos, so that those old viewers will not feel left out in the rain too long.
For example, one new thing not in the beta 1 videos is the Additive effect when drawing with the SpriteBatch, creating a nice lighting effect.
Another is a redesign of the Mouse class, along better design values. I’m happy with it now.
Interviews and Weekly Updates
The interview with Mark was a success, mostly because I enjoyed making the interview. Yes, the feedback was positive too. (c: As Gregory was hinting at, there might be another one(?) coming up… (c:
I’ve also finished writing a weekly update, but I’m going to wait until tomorrow with publishing it, so that the one after that will come on the 11th of December… (c:
Cheers!
Joran




on December 3rd, 2006 at 7:20 pm
Tjena Jöran!
Thanks for yet another great tutorial. I’m looking forward to the next one. I’ve learned more on your five tutorials than I have in 2 years with Java-programming at school, although I believe I maybe a bit more prepared than complete new beginners would be, since I know most of the vocabulary and such already.
Cheers,
Johan
on December 3rd, 2006 at 9:21 pm
Joran,
I’ve had a problem running the latest build. I can successfully build the project without error, but once it runs, I get the following error:
In Engine.cs
this.spriteBatch = new SpriteBatch(this.graphics.GraphicsDevice);
Error says “InvalidOperationException was unhandled”
I was getting a similar error using Beta 1, but was able to resolve it by using this code in the Game1.Designer.cs:
private void InitializeComponent()
{
this.graphics = new Microsoft.Xna.Framework.Components.GraphicsComponent();
this.graphics.AllowMultiSampling = false;
this.GameComponents.Add(this.graphics);
}
Any ideas? This is kind of holding me back a bit.
Pete
on December 3rd, 2006 at 10:06 pm
Peter,
The error that you are getting is because your video card does not support the minimum shader requirements for XNA (at least shader 1.1) You were able to work with beta 1 because there was an error in the code that the XNA development team cleaned up for beta 2.
There are a few posts in the MSDN forums discussing this problem, but there really is no workaround now for beta 2 other than upgrading your video card.
And Joran, I hope you got my email.
on December 3rd, 2006 at 11:45 pm
Peter, listen to George. He’s right. You need to buy a new graphics card, but you don’t need to spend that much.
Buy a card from early last year, and you’ll be fine without cleaning out your wallet.
Or, you can talk to the sales person, and upgrade your computer for Vista while your there, if you’re loaded…
George, thank you for answering. And, yes, I have your email in the inbox. I was just about to sit down with it today, after a bit of sightseeing with my parents. I’ll drop you an email this evening, so you can take a look. It’s Monday, and evening Thai time means Monday morning for you.
Cheers!
Joran
on December 4th, 2006 at 1:08 pm
Gentlemen,
Thank you for the prompt response. I figured that was the issue. Unfortunately, I am using a laptop and I think I would need to buy a new one in order to upgrade the graphics card. Am I wrong? My wife has a newer laptop. I will attempt running XNA on her laptop.
Thanks Again,
Pete
on December 5th, 2006 at 1:31 pm
hi!
XNA really is neat!
Thanks for another interesting tutorial
btw, are u too located in sweden?
I read this today: http://www.sga.to/node/153 :):):):)
on December 6th, 2006 at 11:57 am
[…] XNA: XNAtutorial.com » XNA Tutorials Pack 5 (xna ) […]
on December 7th, 2006 at 12:51 am
Johan: “I’ve learned more on your five tutorials than I have in 2 years with Java-programming at school, although I believe I maybe a bit more prepared than complete new beginners would be, since I know most of the vocabulary and such already.”
Tjenare och tjopps! It is catch 22 for me. Yes, I know the first three packs have a pretty steep learning curve, but the point of them is to just give a feel for the vocabulary. People which have never hear of OOP before will probably balk a bit.
I do feel that it is worth it, though, for two reasons:
1. I can do OO programming from the word go, which means there won’t fifteen minutes of refactoring at the start of each video.
2. The deeper understanding of the vocabulary will come as I put up more and more ‘practice’ videos, as the series progresses. Eventually, people will see the fir videos as a vocabulary primer, and will forgive me. (c:
Right now, though, while there are only five packs, that mnight not be something people see yet. But, trust me, I do have a plan. (c:
Orvar: “btw, are u too located in sweden? I read this today: http://www.sga.to/node/153″
Hallå på dig också! Thank you. No, I’m currently living in Thailand, although I hail from the northern forests of Sweden… I wish I could have been at KTH. Will you be there tonight?
Cheers!
Jöran med J, som jag alltid måste tillägga…
on December 7th, 2006 at 2:19 pm
hi Jöran!
‘I wish I could have been at KTH. Will you be there tonight?’
They said some interesting things and. everything was recorded so it should be on their site soon i think. me and two friends are going to compete in the xna category in the swedish game awards, making some kinde of rts-thing. i’ll show you our progress some day.
yep, i was there and it was fun
btw, saknar du inte julen? fick en jävla massa julmust på föreläsningen idag
//Orvar
on December 7th, 2006 at 10:32 pm
The thing I hate about being in Thailand is that I miss out on a lot of XNA events, and events in other interests as well. I would have been cool to show up at the XNA Teams party on Monday, for example, and meet a lot of people on person.
But, oh, well, I have the sun, a loving wife, and a satisfying job. I shouldn’t complain.
Swedish answer (you’re not missing anything):
Nej, för helvete, det mesta finns här, man bara skippar att det är så jävla kallt… Det blir köttbullar, julskinka med äppelmos, ägg med sill och Kalles Kaviar, palt med lingonsylt, knäckebröd med messmör och lax, och annat mumsigt. Det enda som inte finns att köpa här är lingonsylt och messmör, men frugan jobbar på ambassaden, så det ‘importeras’.
Dessutom kommer föräldrarna och båda syskonen med familjer hit. Vi ska ut och titta i julskyltfönster nu. Jul är ju en kommersiell händelse, så att Thailändare är buddister spelar inte så stor roll - jul är nästan lika stort här som hemma.Det blir kul - en vanlig svensk jul, fast i Thailand!
Jag tror knappast det blir något gjort på XNA! (c: