Animating a sprite, incredibly fustrated

  • (2 Pages)
  • +
  • 1
  • 2

15 Replies - 4470 Views - Last Post: 04 November 2010 - 02:12 PM

#1 Dev1462  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 145
  • Joined: 20-May 10

Animating a sprite, incredibly fustrated

Posted 13 October 2010 - 06:27 AM

Can i get a decent tutorial that kind of breaks down the whole process of animating a sprite, along with source code? Ive been going through quite a few tutorials and every since one is just not good and overly confusing
Is This A Good Question/Topic? 0
  • +

Replies To: Animating a sprite, incredibly fustrated

#2 Kilorn  Icon User is offline

  • XNArchitect
  • member icon



Reputation: 1355
  • View blog
  • Posts: 3,528
  • Joined: 03-May 10

Re: Animating a sprite, incredibly fustrated

Posted 13 October 2010 - 06:38 AM

I'm really surprised that there isn't already a tutorial on how to do this on this site. I'm at work right now, so there's no way I can get it done now, but when I get home tonight I'll throw together a tutorial for you on how to do this. It's actually really simple once it's broken down. Is there anything specific that you're having trouble understanding right now that I might be able to help you out with for now?

EDIT: I found a couple posts from Hellbroth about 2d animation.

http://www.dreaminco...cter-animation/

http://www.dreaminco...-on-xna-part-1/

Hopefully these can help you, but if not, I'll still see if I have time tonight to write up a quick tutorial for it.

This post has been edited by Kilorn: 13 October 2010 - 06:54 AM

Was This Post Helpful? 2
  • +
  • -

#3 Dev1462  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 145
  • Joined: 20-May 10

Re: Animating a sprite, incredibly fustrated

Posted 13 October 2010 - 10:59 AM

a quick basic animation tutorial would be so nice. Its just that they all seem to have such radical approaches to doing it and some are just over the top unecessary and others are customized/Hardcoded to their sprite and it makes it hard on me
Was This Post Helpful? 0
  • +
  • -

#4 Shane Hudson  Icon User is offline

  • D.I.C Technophile
  • member icon

Reputation: 342
  • View blog
  • Posts: 1,286
  • Joined: 06-December 09

Re: Animating a sprite, incredibly fustrated

Posted 13 October 2010 - 02:03 PM

Hmm well simple things would be like this psuedocode:

If right arrow key then use sprite - right
If left arrow key then use sprite - left
If fighting then use sprite - fighting



Obviously there are many ways to improve it. I am currently working on one right now actually so may post a tutorial once it is finished.
Was This Post Helpful? 0
  • +
  • -

#5 Dev1462  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 145
  • Joined: 20-May 10

Re: Animating a sprite, incredibly fustrated

Posted 13 October 2010 - 03:22 PM

View PostShane Hudson, on 13 October 2010 - 01:03 PM, said:

Hmm well simple things would be like this psuedocode:

If right arrow key then use sprite - right
If left arrow key then use sprite - left
If fighting then use sprite - fighting



Obviously there are many ways to improve it. I am currently working on one right now actually so may post a tutorial once it is finished.


Well, i can do that...thats childs play, but im looking for a way to use multiple sprites string together to make it seem like the sprite is moving. turns out that there are a lot of factors and some things that are a bit over my head. No only that but the people who write the tutorials add a lot more stuff that make it hella confusing
Was This Post Helpful? 0
  • +
  • -

#6 Kilorn  Icon User is offline

  • XNArchitect
  • member icon



Reputation: 1355
  • View blog
  • Posts: 3,528
  • Joined: 03-May 10

Re: Animating a sprite, incredibly fustrated

Posted 13 October 2010 - 06:39 PM

Alright, I wrote the tutorial and submitted it here, so hopefully we'll hear something about it soon and I'll link you to it asap.
Was This Post Helpful? 1
  • +
  • -

#7 Dev1462  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 145
  • Joined: 20-May 10

Re: Animating a sprite, incredibly fustrated

Posted 14 October 2010 - 08:01 AM

Ok sweet, now we just need a separate section for XNA tutorials xD thanks a bunch man! i hope they put it up ASAP
Was This Post Helpful? 0
  • +
  • -

#8 Kilorn  Icon User is offline

  • XNArchitect
  • member icon



Reputation: 1355
  • View blog
  • Posts: 3,528
  • Joined: 03-May 10

Re: Animating a sprite, incredibly fustrated

Posted 14 October 2010 - 08:03 AM

Yea, hopefully it'll be approved today.
Was This Post Helpful? 0
  • +
  • -

#9 Dev1462  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 145
  • Joined: 20-May 10

Re: Animating a sprite, incredibly fustrated

Posted 14 October 2010 - 05:20 PM

Sigh, i feel like it wont be today :( can you link it to me in anyway besides on here. maybe i can get an early version?
Was This Post Helpful? 0
  • +
  • -

#10 Kilorn  Icon User is offline

  • XNArchitect
  • member icon



Reputation: 1355
  • View blog
  • Posts: 3,528
  • Joined: 03-May 10

Re: Animating a sprite, incredibly fustrated

Posted 14 October 2010 - 06:00 PM

Well, I wrote it up in Word, and there are html tags all over the place, so even if I did e-mail it to you, it would be a mess trying to make sense of it with all those tags.

EDIT: Here's hoping for approval tomorrow, or tonight before I go to bed.

This post has been edited by Kilorn: 14 October 2010 - 06:01 PM

Was This Post Helpful? 0
  • +
  • -

#11 Kilorn  Icon User is offline

  • XNArchitect
  • member icon



Reputation: 1355
  • View blog
  • Posts: 3,528
  • Joined: 03-May 10

Re: Animating a sprite, incredibly fustrated

Posted 15 October 2010 - 10:09 AM

EDIT: Nevermind.

This post has been edited by Kilorn: 15 October 2010 - 10:12 AM

Was This Post Helpful? 0
  • +
  • -

#12 bonyjoe  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 175
  • View blog
  • Posts: 548
  • Joined: 08-September 10

Re: Animating a sprite, incredibly fustrated

Posted 15 October 2010 - 11:23 AM

load in your sprite sheet
make a source rectangle that is (0 , 0, single sprite width, single sprite height)
make

const int rows = amount of sprites per column on the sprite sheet
const int columns = amount of sprites per row
const int frames = rows*columns
int currentFrame = -1



determine which sprite to display by changing the source rectangle

            currentFrame++;
            currentFrame %=frames;
            rect.X = (currentFrame % columns) * rect.Width;
            rect.Y = (currentFrame / columns) * rect.Height;



then in the draw code make sure you use the source rectangle to only draw the single sprite and not the whole sheet
Was This Post Helpful? 0
  • +
  • -

#13 arrezes  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 58
  • Joined: 17-October 10

Re: Animating a sprite, incredibly fustrated

Posted 19 October 2010 - 08:20 PM

View Postbonyjoe, on 15 October 2010 - 10:23 AM, said:

load in your sprite sheet
make a source rectangle that is (0 , 0, single sprite width, single sprite height)
make

const int rows = amount of sprites per column on the sprite sheet
const int columns = amount of sprites per row
const int frames = rows*columns
int currentFrame = -1



determine which sprite to display by changing the source rectangle

            currentFrame++;
            currentFrame %=frames;
            rect.X = (currentFrame % columns) * rect.Width;
            rect.Y = (currentFrame / columns) * rect.Height;



then in the draw code make sure you use the source rectangle to only draw the single sprite and not the whole sheet


if you're into VC# 2008 and XNA i have a good tutorial myself
Was This Post Helpful? 0
  • +
  • -

#14 Kilorn  Icon User is offline

  • XNArchitect
  • member icon



Reputation: 1355
  • View blog
  • Posts: 3,528
  • Joined: 03-May 10

Re: Animating a sprite, incredibly fustrated

Posted 19 October 2010 - 08:42 PM

I still haven't heard anything about the tutorial I wrote and submitted, but I did go ahead and send it to . I'd really like to hear something back from the people in charge of the tutorials soon, though. It's been almost a week and still not a single word.

This post has been edited by Kilorn: 19 October 2010 - 08:43 PM

Was This Post Helpful? 0
  • +
  • -

#15 Kilorn  Icon User is offline

  • XNArchitect
  • member icon



Reputation: 1355
  • View blog
  • Posts: 3,528
  • Joined: 03-May 10

Re: Animating a sprite, incredibly fustrated

Posted 01 November 2010 - 07:16 AM

I logged in today to find that my tutorial had been approved, so I wanted to update this thread and let you know that it's up there now.

http://www.dreaminco...nimated-sprite/
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2