George Clingerman

      XNADevelopment.com
posts - 151, comments - 424, trackbacks - 181

My Links

News



Tag Cloud

Article Categories

Archives

Post Categories

. XNADevelopment.com .

XNADevelopment.com - The Wizard: Part One (2.0)

thewizard First, I just want to say thanks for all the great feedback I've gotten in comments and email. I don't make any money from doing these tutorials, I don't want donations and I'm not a fan of ads so your comments are what keep me going. Silly I know, but just a little "Thanks!" really does make all the work that goes into the site and these tutorials worth it. So "Thanks!" for the comments and emails. Keep them coming! I love hearing back from people using the tutorials and benefiting from them.

I have been working on completely re-doing the Wizard tutorial and the re-write is now down and posted. I have broken this tutorial into four parts to make it a bit more digestible and easier to follow. This is Part 1 and it covers getting basic input from the player via the keyboard and then using that input to move a sprite around on the screen.

You can head on over and check out, The Wizard: Part 1- Moving a Sprite around the Screen.

As always, the source code is provided along with the tutorial and feedback is strongly encouraged and welcome. Enjoy!

Technorati Tags:

Print | posted on Saturday, March 15, 2008 9:37 AM | Filed Under [ XNA Development XNA ]

Feedback

Gravatar

# re: XNADevelopment.com - The Wizard: Part One (2.0)

Awesome, helped lots!
3/20/2008 9:52 PM | Cameron
Gravatar

# re: XNADevelopment.com - The Wizard: Part One (2.0)

Great didatic, great tutorial.Just simple and useful.
thanks (:
5/5/2008 5:47 AM | Caio
Gravatar

# re: XNADevelopment.com - The Wizard: Part One (2.0)

You're tutorials are amazing. So simple and easy to understand!
5/8/2008 6:53 PM | Mike
Gravatar

# re: XNADevelopment.com - The Wizard: Part One (2.0)

Great introduction to inheritance.
Thanks very much for all your hard work! Wish I could buy you a beer.
5/23/2008 10:03 PM | Mycenae
Gravatar

# re: XNADevelopment.com - The Wizard: Part One (2.0)

I really like your tutorials a lot. I have been looking a lot of places for XNA game development for beginners and your site actually caught my time the longest.

I will definitely continue reading on your other projects. Right now I am looking for tutorials to deal with mouse event handlers. Hope to find something similar on your next tutorials. Thanks
7/28/2008 3:30 PM | MiMi
Gravatar

# re: XNADevelopment.com - The Wizard: Part One (2.0)

Thank you for all the tutorials. i am beginner and you have helped me understand how things work. I still need to learn a lot, but this is the best place i have found on the net to get started.

Thank You

Attila
8/12/2008 9:16 PM | Attila
Gravatar

# re: XNADevelopment.com - The Wizard: Part One (2.0)

Thank you. I've been a programmer for years but just started tinkering around with game developemnt. These tutorials are the perfect starting place. Your sprites collection is very good too.
8/31/2008 8:01 AM | Frank
Gravatar

# re: XNADevelopment.com - The Wizard: Part One (2.0)

Thanks a lot for this great tutorial! I was just wondering if you could actualy explain the best way to flip the sprite so it follows the orientation. :) That would be even more awesome! Once again, thank you!
9/16/2008 4:42 PM | Guillaume
Gravatar

# re: XNADevelopment.com - The Wizard: Part One (2.0)

I just completed this tutorial with my own sprites and I gotta say I'm loving it. Your tutorials are all so clear and well explained. keep up the good work.

I look forward to seeing more tutorials soon :)
10/13/2008 11:11 AM | Andrew
Gravatar

# re: XNADevelopment.com - The Wizard: Part One (2.0)

Thank you. I just finished moving my Wizard.
you're so cool !!
10/31/2008 8:19 PM | Yuna
Gravatar

# re: XNADevelopment.com - The Wizard: Part One (2.0)

Excelent tutorial for people that is new to XNA.
11/6/2008 4:55 PM | Ricardo
Gravatar

# re: XNADevelopment.com - The Wizard: Part One (2.0)

IT is really a great tutorial, easier than the one I found in MS official website.

However I want to ask something that when i complie project on XNADevelopment.com - The Wizard: Part One (2.0)
after making sprite class changes I got an error in project that mSpriteTexture is null (for scale property), and that is rightly so as my Game1.cs init function is trying to set Scale property before LoadContent gets called where we set that variable. so I guess you need to initialize mSpriteTexture before that.
11/11/2008 11:48 PM | Sumit Guta
Gravatar

# re: XNADevelopment.com - The Wizard: Part One (2.0)

I had the same problem with the compilation error saying mSpriteTexture is null. To make the code compile correctly I omitted it and just put Scale instead of the multiplication of width and the multiplication of height in the specified regions and finished the coding. I didn't find any errors so now I don't even know the importance of this section of coding. Any explanations are greatly appreciated and I greatly appreciate your tutorials and how you stay true to object orientated mentality. Coding is much simpler and cleaner when following that approach.
12/19/2008 11:51 PM | Jeffrey Schmidt
Gravatar

# re: XNADevelopment.com - The Wizard: Part One (2.0)

Excellent tutorials, very clearly explained and based on good design principles, good stuff, thank you
1/1/2009 4:38 PM | Jim
Gravatar

# re: XNADevelopment.com - The Wizard: Part One (2.0)

I also had the same problem. But putting scale there only will not serve it's purpose. I just placed an if condition to check that if the texture has been loaded, then apply the size to the sprite.


public float Scale

{

get { return mScale;}

set

{

mScale = value;

//Recalculate the Size of the Sprite with the new scale
Size = new Rectangle(0, 0, (int)(mSpriteTexture.Width * Scale), (int)(mSpriteTexture.Height * Scale));

}

}


TO


public float Scale
{
get { return mScale; }
set
{
mScale = value;

// If mSpriteTexture is set, then
if (mSpriteTexture != null)
//Recalculate the Size of the Sprite with the new scale
Size = new Rectangle(0, 0, (int)(mSpriteTexture.Width * Scale), (int)(mSpriteTexture.Height * Scale));
}
}

1/17/2009 6:51 PM | Syed

Post Comment

Title  
Name  
Email
Url
Comment   

Powered by: