XNA

Published October 22, 2006
Advertisement
Back at the end of August, I downloaded the XNA Game Studio Express Beta. Until this weekend, I really hadn't experimented with it at all. I had glanced at the SpaceWar code, but I hadn't really written a program of any sort.

It occured to me yesterday that I probably should learn XNA, given the fact that this framework will eventually allow me to develop games for my Xbox 360. Being able to have my games played on a game console has been something I've wanted since I started to program. So, with that in mind, I decided to experiment a little with XNA.

So after a few minutes, I had a blank window. It would have taken less, but I made sure to reformat the code so it wasn't like this:

public int stuff() {
int i = 4;
}

I personally can't stand that formatting, it confuses me a great deal. Sadly for me, all the template code you're given is formatted like this.

Anyways, I decided then that I should learn how to draw a sprite. A few minutes later, I drew a hand drawn picture I had made to the screen. I must say it was quite easy. What suprised me was that I was under the impression that I would be required to use the 3D coordinate system. I found that I could actually use the coordinate system I'm already familiar with from programming 2D games.

At this point, I pretty much realized that anything I could do in SDL, I could also do in XNA. Given enough time, I could probably recode Blocky Man in XNA. There are a few issues though. For instance, having to create a masked image for transparency. One of the main reasons that I started using Allegro, and later SDL, is because of color key transparency. However, I think I could get over that difficulty, and it might end up helping in some respects. I was thinking that I might try to code a robotron clone with stick figures and such. It would also have vehicles that take advantage of XNA's sprite rotation capibility. That would be a pretty cool side project.

With the regards to 2D sprite drawing, the documentation was very helpful. I can't say the same for 3D rendering, which I wanted to try out. When I created a program from the 3D code given in the documentation, it didn't render anything. I tried many different variations, with no luck.

I wish the package came with some examples. I know SpaceWar is supposed to be a big example, but I didn't really find it helpful. Especially, since I can't seem to play it without a common controller. It would be nice to have specific example programs, like "rendering a triangle" and "transformations". However, I know that several sites are currently creating such tutorials.

Apparently, in December, the full package will come out. I think at that time I'll really start to use it, but until then, I'll just stick to C++ and SDL. December isn't really that far away anyways, and I can't say Blocky Man will be done then either(probably not). However, I'm really looking forward to seriously using XNA, and maybe getting a game running on my 360.

I did become a member on OpenXNA. I don't think I'll have any content for a little while, but I wanted to make sure no one took the name "Stompy"[lol]

------Completely unrelated-----------------------------------------------

I saw "Flags of our Fathers" today. It's a great movie, and I definetly recommend it. Quite an interesting way to tell a story in a movie, but
it seems to work well. Basically, most of the actual Iwo Jima scenes are
told as flashbacks that the soldiers are having. It's a good idea, but it
can make the timeline seem confusing at times. I'm always a fan of World
War II movies, and this one is pretty good.

-------------------------------------------------------------------------
Previous Entry Blarg!
Next Entry The stampede
0 likes 5 comments

Comments

takingsometime
I can't offer up much help on the other XNA topics, but XNA Spot has a walk-through of how to get keyboard input working for the basic Space War game here .
October 22, 2006 09:13 PM
Programmer16
You can change the formatting settings for C# Express Edition/Game Studio Express (Tools menu item, Options, Text Editor - C# - Formatting) and then reformat the document (ctrl+e then ctrl+d) which should take care of that automatically (it does for me.)

Good luck!
October 22, 2006 10:02 PM
LachlanL
Hey,

From memory you can use colour-keys with textures by specifying the RGB value when you load the texture. That colour will then be considered 100% transparent black.

I don't know if there's any special trick you need to do to get this in XNA as I haven't used it yet. Sorry.

Regards,
Lachlan.
October 23, 2006 12:44 AM
Programmer16
Oops, I missed your transparency statement. You can do alpha transparency in XNA using an alpha layer (png, tga, etc) and then when you call SpriteBatch.Begin() you can specify SpriteBlendMode.AlphaBlend and it'll automatically setup alpha blending for you.

RobLoach, Krisc, and I are work on some articles and projects at OpenXNA.

HTH!
October 23, 2006 02:00 AM
Stompy9999
Well, if it is possible to have color keys with XNA, than I'm even more on board than before. I'll probably switch to using XNA after I finish Blocky Man.

I got my account on OpenXNA, Just in case I decide to make something with it and post it.
October 23, 2006 05:50 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement
Advertisement