Geeks With Blogs
Scott Miller Appsguild - Software craftsmanship, project management, and the biz of software
After long last, I have started to mess around with XNA 2.0.

I really like George Clingerman's tutorials here on GWB, as well as George's XNADevelopment.com site.

If I make a game, what kind of game would I like to make? As I have said before, I spend more time playing old Nintendo games downloaded on the Virtual Console on my Wii - old Zelda and Metroid. So I think I will try to make an RPG.

I have messed around with RPG's before, using Microsoft's Crusader RPG starter kit, on the Coding4Fun part of the site, from the time before XNA. An RPG with ugly graphics.

Although the graphics are ugly, the game code does have a good tutorial and code on creating tile maps loaded from files (in this case they are csv and text files).

So I am on my way. Using George's sprite code from his tutorials, I want to create an animated sprite of a typical walking RPG avatar. I used Charas RPG Maker site to create my animated sprites (more on this site in my next post).

The resulting sprite has three frames of animation walking in all directions.

I quickly figured out that it is difficult to animate a walking sprite. If you have one frame per touch of the arrow key it is not too bad, but otherwise he flails wildly. I tried to use code from Crusader to add walking frame rates but Crusader treats each tile as an individual "hex", something that I was not doing. I finally found some sample code - Animating Sprite Sheets and Sprite Movement, which adds in a variable framerate that keeps the walking smooth, slow, and non-jerky. I put this code together with George's stuff and came up with this:

In the above frame, I have an animated, walking avatar knight (which responds to arrow keys) and an animated zombie that walks in place.

Here is the source code: rpgTutorial1.zip.

Also in my travels, I came across an excellent set of RPG tutorials by Nick on nick.gravelyn.com that include tile engines, sprites, NPC dialog windows, etc.

Posted on Tuesday, April 8, 2008 7:24 PM | Back to top


Comments on this post: XNA RPG Tutorial

# re: XNA RPG Tutorial
Requesting Gravatar...
i can download XNA rpg?!
Left by kfvajsfKSsssss on May 31, 2009 2:00 PM

Your comment:
 (will show your gravatar)


Copyright © Scott Miller | Powered by: GeeksWithBlogs.net