Third Tutorial
I just got hired to do a ten-day project, besides from my teaching job, so I probably won’t have time to make another tutorial during this coming week or two.
The Fat One
Therefore, here is a mother of a tutorial. It is 38 minutes long. Now you have something to chew on while I’m gone.
I hope I don’t sound too tired by the end of it. I finished shooting it pretty late last night, so I saved the editing for today.
Tutorial Links
All three tutorials are available over at learnxna.com. They also have their own tutorials, which you should check out.
All my tutorials are available on this site too - first, second, third.
Camtasia
I tried out the demo of another recorder program for this tutorial. I like it, and might keep using it. It is Camtasia.
I find it interesting that Camtasia’s screen recorder program looks identical to the GNU General Public Licensed CamStudio… Maybe there is a fish in there? (c:
I also noted that Microsoft must have bought code from Camtasia, because their MovieMaker program looks exactly the same as Camtasia. Funny how code travels, even to places where it is not allowed. I am not saying that Microsoft stole GNU code. They have cleared their backs, because they have rewritten the screen recorder portion from scratch.
Trivia before viewing
I made the mistake to turn on keyboard sound the first time with Camtasia. I promise it will not be turned on in the future.
When you view the tutorial, pay attention to the pause I make when naming the variable to store the image. What mental picture do you think I’m pondering at that moment? (c:
Also, in my Art folder, I keep two images. Note that I managed to avoid saying “In here, I keep my balls.” (c:
Pop-quiz after viewing
Here’s a test for you, while you wait for the next tutorial.
I loaded the image and assigned the SpriteBatch in the OnStarting method. Try moving those two lines of code to the constructor instead. Does the code still run?
Why didn’t I assign in the constructor? Where can you find an answer by yourself?
*Wringing his hands* Mua-ha-ha! I’m not telling you!
Cheers!
Joran
Sorry, there are no polls available at the moment.




on September 12th, 2006 at 10:19 pm
Rock! I finally get my fix!!
Doh! Guess it will have to wait, work calls…
on September 12th, 2006 at 10:40 pm
You forgot to yell “FIRST POST” (c:
Anyhow, I’m off to work too. Sucks, doesn’t it…
Cheers!
Joran
on September 13th, 2006 at 11:58 am
Nice tutorial, as always!
This time little longer
P.S. Whats your email?
Cheers
Stefan Virag
on September 13th, 2006 at 6:54 pm
Thank you!
You can email to xnatutorial.com, just put anything you like before the at-sign. It all gets redirected to joran [at] omark [dot] org.
on September 19th, 2006 at 6:10 pm
Hey Joran, just started to watch the videos, and I love them so far. Now I want more, lol.
Anyway, could seem to run XNA code on my laptop, I guess an ATI Express 32MB card just doesn’t cut it. But, if you add this line of code that sets the AllowMultiSampling property to false, it seems to run.
graphics.AllowMultisampling = false;
Add this in the game1.designer.cs file, right after the instance of the Graphics component is created. Just thought everyone could use the tip if your programs aren’t compiling. Take care. Joran: Where’s tutorial #5. You know, the one with bump mapping and vertex shaders, lol.
on September 19th, 2006 at 9:54 pm
I just stumbled upon this site and the tutorials have been great. I really appreciate the work you’re doing here. Hope to see more in the future!
on September 20th, 2006 at 5:52 am
Good tip to turn of multisampling, Ghaladen! I haven’t touched on graphics hardware compatibility yet, as I figured that’s a pretty advanced subject. But eventually, I will.
Ghaladen: “Where’s tutorial #5. You know, the one with bump mapping and vertex shaders, lol.”
Heh! Well, that will be tutorial #50, you mean? (c: Patience is a virtue…
johnny: “the tutorials have been great”
You’re welcome, johnny! We aim to please. I think I do dare promise number five before the weekend.
on September 20th, 2006 at 1:46 pm
When will you begin touching 3d programming?(IF you ever talk about it…).
on September 21st, 2006 at 10:08 am
roule: “When will you begin touching 3d programming?”
People keep asking me this, so this answer is for all of you.
Short answer: Once I get learning the C# language and basic game programming out of the way, half-a-year from now.
Long answer: There will be two activities going on paralell to each other in the beginning. The main focus is on the C# language. At the same time, progress is made on a 2D game. Once the language bit is done, I’ll try to round off the game as well.
By that time, the 2D game should have implemented a menu, sound, input, AI, and 2D graphics, giving people a good grasp of both C# syntax and the XNA framework.
Then, it will be time to replace the 2D part of the game with a 3D engine. With a good enough design, we should be able to reuse the rest of the code. 3D is so advanced, that I don’t want to mix it with the C# language learning part. But by the time we get to it, 3D should be a breeze, at least compared to jumping straight into it.
So, what does this mean in time units? Well, I have a job, a family, and a life besides XNA, and we have a lot of ground to cover. My preliminary estimate is that the 2D game will be playable by the time XNA leaves beta status, although not releasable, and we should be finished with the C# primer a bit before that. But don’t hold me to it. That’s why I give myself six months.
If this is too slow for you, you’re probably too l33t to waste your time with my simple, little tutorials. (c: There are other, better, resources for you to check out. If you just want to play around with some basic 3D code in XNA, check out Justin O’Dell’s Kukyona.
As a side note, I have actually the first five or six tutorials of the 3D section sketched out, with illustrations and everything. I wrote them down while fiddling with MDX2 beta, before XNA beta was released. I won’t shoot them until it’s time, though. I’d rather keep the speed up on releasing the basic ones.
As a second side note, because of the military coup here in Thailand, I had a day off. I shot the fifth tutorial already. I will do some minor edits (mostly pasting reels together - too lazy to do any more), encode, and upload it tomorrow, Friday.
Cheers!
on September 21st, 2006 at 10:26 pm
[…] Daniel Crenna has just started covering the basics of 3D math for XNA, which is nice, because I won’t get to that in a long time (I commented on that at the bottom). […]
on September 23rd, 2006 at 6:24 pm
I am new to C#. I just Got it and stumbled on your site. Thanks for hard work to show me how to get started. I thought that you should include the files that are covered in your tutorials, like the “ball” or did i miss that somewhere. I will make my own (guess ill hafta anyway, but i am not the artist).
Keep it up, i like and appreciate this.
Mahalo Nui Loa
on September 23rd, 2006 at 7:04 pm
Yes, I know I haven’t included the source code and art resources. The project hasn’t been big enough to do that, but by tutorial five, it is getting big enough.
However, if I do include it, people will not type it in themselves, and that is a learning experience in itself. I don’t know. Maybe as a separate download? I’ll make a poll about it.
Cheers!
Joran
on September 24th, 2006 at 7:03 am
Aloha,
Sorry, i meant only the resource files, not the actual source code. I agree, can’t learn if ya dont do it yourself.
A Hui Ho
on September 24th, 2006 at 7:25 am
Ah, well, the graphic I’m using is just a placeholder too, so don’t worry, use your own placeholder until I get the source/resources up here. You do know of the Ari Feldman’s free sprite library, right? And his now free book on designing 2D graphics? Ari is a good man!
I do have plans to include the basics of 3D modeling in this series. It’s gonna be needed by the time we get into 3D programming anyway, so a short intro to Blender might show up around tutorial ten or so (way before 3D programming, though).
on September 25th, 2006 at 9:34 pm
Ghaladen: “…sets the AllowMultiSampling property to false, it seems to run…”
I just noticed that according to the documentation, you should not have to turn it off manually, because if the hardware doesn’t have the capabilities for multisampling, XNA should simply turn it off for you.
I can’t check if this is an actual bug in XNA or the documentation, because I don’t have the hardware to do so, but maybe someone can. And if it’s not already reported to Microsoft, I’m sure the XNA team would like to hear about the discrepancy.
on October 19th, 2006 at 2:10 pm
You ROCK
THANK YOU for taking the time to create these excellent tutorials.
on January 8th, 2010 at 1:04 am
HI, I am a newbie on this XNA thing….
Up till now, your tutorials have been helpful and they’re great…!!! However, I have problem with this third tutorial… Seems that the XNA can’t recognise the “onStarting()”….
Any suggestion???