Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411613 Posts in 69390 Topics- by 58447 Members - Latest Member: sinsofsven

May 09, 2024, 09:58:13 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperArt (Moderator: JWK5)How do you animate sprites?
Pages: 1 [2] 3
Print
Author Topic: How do you animate sprites?  (Read 5508 times)
Kiriban
Level 0
***



View Profile
« Reply #20 on: July 14, 2012, 06:15:35 PM »

Kitheif is a good friend, by the way Swarms uses photoshop just early and graphics gale has a full version which has better features
Logged
i wanna be the guy
Guest
« Reply #21 on: July 14, 2012, 06:19:01 PM »

why do you keep bolding things
Logged
Miko Galvez
Level 7
**


Designer & Engineer


View Profile WWW
« Reply #22 on: July 14, 2012, 06:20:14 PM »

Best thread ever FOREVER? Where's Ashkin we need him more than ever

on a serious note, is autism contagious? you know, like through the internet

bolding will become a meme now
Logged

Kiriban
Level 0
***



View Profile
« Reply #23 on: July 14, 2012, 06:22:52 PM »

Its bin a meme since before, i just bold texts if its referring to someone's or something's name
Logged
HöllenKobold
Level 10
*****



View Profile
« Reply #24 on: July 14, 2012, 06:26:10 PM »

I animate in Game Maker.
Logged

Hell pits tend to be disguised as
things that would lead a passerby to
not think of them as portals to
eternal gnashing and wailing.
rdein
Guest
« Reply #25 on: July 14, 2012, 06:26:22 PM »

even i am creeped out

when are we gonna ban him
Logged
Kiriban
Level 0
***



View Profile
« Reply #26 on: July 14, 2012, 06:28:48 PM »

The hell is your problem sis  Shocked

I derailed this topic because of this:
basically if you want to be a good animator what you have to do is summon the powers of the great wizards from the fifth dimension and pray to the lords of the astral plane to grant you the power to find a great deal on a custom made harley from a pawn shop nearby, inside that harley will be the tools you need to fix up your creaky wooden stairs
when you fix those up you will be enlightened with the knowledge of how to please your girl. when you make her extremely happy she will explain to you how to properly animate like the experts
Logged
rdein
Guest
« Reply #27 on: July 14, 2012, 06:29:34 PM »

the hell is yours
Logged
Kramlack
Guest
« Reply #28 on: July 14, 2012, 06:30:03 PM »

Ein, are you still going around as a girl? I don't get why he keeps calling you one.

EDIT: Just checked your profile, indeed you are.
Logged
rdein
Guest
« Reply #29 on: July 14, 2012, 06:32:03 PM »

im a beautiful 16-year old (virgin) anime Princess from Japan (kyoto)

kissus to vincent-chan-kun :**************
Logged
Kiriban
Level 0
***



View Profile
« Reply #30 on: July 14, 2012, 06:32:46 PM »

 Kiss
Logged
EBrown
Level 0
**



View Profile
« Reply #31 on: July 14, 2012, 06:36:07 PM »

Usually when I animate I do it in two stages:

1. I setup everything in a tile-based system. Gridlock so to speak.
2. I setup an array that corresponds to the position and size of the animations needed. For example, if I am using variable-size sprites, I setup a multidimensional array that has the first dimension being the sprite, and then the second being the ((DIRECTION * ANIMATIONS_PER_DIRECTION) + CURRENT_ANIMATION_FRAME).

Here is an example I am using in C++ with DirectX:

Code:
RECT gPlayerAnimationSources [1][16] = {{{0, 0, 32, 48},{32, 0, 64, 48},{64, 0, 96, 48},{96, 0, 128, 48},
                                         {0, 48, 32, 96},{32, 48, 64, 96},{64, 48, 96, 96},{96, 48, 128, 96},
                                         {0, 96, 32, 144},{32, 96, 64, 144},{64, 96, 96, 144},{96, 96, 128, 144},
                                         {0, 144, 32, 192},{32, 144, 64, 192},{64, 144, 96, 192},{96, 144, 128, 192}}};

This is used with the directions as follows:

0 = Down,
1 = Left,
2 = Right,
3 = Up

In order to do smooth-gridlock movement I setup two vectors in DirectX:

Code:
D3DXVECTOR3 gPlayerPosition = D3DXVECTOR3(0, 0, 0), gPlayerPositionDisplay = D3DXVECTOR3(0, 0, 0);

Then, to update it, I merely check for the difference in one vector versus the other.

Code:
// Update their X position based on whether they are ahead of or behind the real position.
if (gPlayerPosition.x > gPlayerPositionDisplay.x)
gPlayerPositionDisplay.x += factor;
else if (gPlayerPosition.x < gPlayerPositionDisplay.x)
gPlayerPositionDisplay.x -= factor;

// Update their Y position based on whether they are ahead of or behind the real position.
if (gPlayerPosition.y > gPlayerPositionDisplay.y)
gPlayerPositionDisplay.y += factor;
else if (gPlayerPosition.y < gPlayerPositionDisplay.y)
gPlayerPositionDisplay.y -= factor;

This gives a smooth-feeling movement, as I can merely update the "Real" location. Then to draw the animation, I merely check which pixel they are on corresponding to their tile.

Code:
// Are they going left or right? Or Up or down? Setup the tile for them.
if (gPlayerDirection == 1 || gPlayerDirection == 2)
gCurrentTileAnimation = ((4 * gPlayerDirection) + ((int)gPlayerPositionDisplay.x / 4 % 4));
else
gCurrentTileAnimation = ((4 * gPlayerDirection) + ((int)gPlayerPositionDisplay.y / 4 % 4));

The animation get's called with:

Code:
&gPlayerAnimationSources[SPRITE][gCurrentTileAnimation]

And thus, I get fairly decent smooth animation. (I also use this technique in C# when I use XNA.)

Thanks,
EBrown
« Last Edit: July 14, 2012, 06:42:41 PM by EBrown » Logged
BomberTREE
Level 9
****



View Profile
« Reply #32 on: July 14, 2012, 06:36:29 PM »

Quote
Kitheif is a good friend
No.
I asked you to respect the community, we never made up a secret handshake OR ANYTHING..  Lips Sealed

To be on topic, I use graphics gale when I'm in the animating mood.. but it's kinda.. eh
Logged
Kiriban
Level 0
***



View Profile
« Reply #33 on: July 14, 2012, 06:38:05 PM »

So, you don't like anyone of us here in the community didn't you? I just said a good friend not good friend of mine.

@EBrown: Can it run sheets of frames instead of cut-out frames?
Logged
EBrown
Level 0
**



View Profile
« Reply #34 on: July 14, 2012, 06:39:24 PM »

So, you don't like anyone of us here in the community didn't you? I just said a good friend not good friend of mine.

@EBrown: Can it run sheets of frames instead of cut-out frames?
How do you mean?

Thanks,
EBrown
Logged
BomberTREE
Level 9
****



View Profile
« Reply #35 on: July 14, 2012, 06:40:22 PM »

So, you don't like anyone of us here in the community didn't you? I just said a good friend not good friend of mine.
"Didn't you"?
What in the name of absolute huh. I'm no grammar nazi, but please.

Quote
im a beautiful 16-year old (virgin) anime Princess from Japan (kyoto)

kissus to vincent-chan-kun :**************
Oh god.
Logged
Kiriban
Level 0
***



View Profile
« Reply #36 on: July 14, 2012, 06:47:20 PM »

Must visit Ein next year  Kiss
Logged
BomberTREE
Level 9
****



View Profile
« Reply #37 on: July 14, 2012, 07:02:29 PM »

Quote
Ein, are you still going around as a girl? I don't get why he keeps calling you one.
Good luck with that, Vincent.

I noticed you made a new thread on animation, are you already finished with this one?
Logged
Kiriban
Level 0
***



View Profile
« Reply #38 on: July 14, 2012, 07:10:07 PM »

Still not satisfied about my animation thread in workshop, this topic is for those who would like to share their animating techniques to others and ein is a girl
Logged
rdein
Guest
« Reply #39 on: July 14, 2012, 07:10:43 PM »

Must visit Ein next year  Kiss

why next year, i'm here for you
Logged
Pages: 1 [2] 3
Print
Jump to:  

Theme orange-lt created by panic