PDA

View Full Version : Sprites



fdaniels
10-01-2009, 01:31 AM
I had a problem of 'sliding' when a sprite walked across the screen, AKA the moonwalk. This was, of course, because the amount of pixels that they moved per tick did not equal the amount of pixels that each frame was supposed to move.

So I included the offset_x and offset_y for each <Frame/> element in the XML document describing the sprite. Is it my imagination, or does the offset_x really dictate the movement as well. Ever since I included that information my animations seem a lot better, though it 'could' be my imagination.

fdaniels
10-01-2009, 02:41 AM
Lets say I have a spritesheet. Is it efficient to have 8 animations on it? I mean would each sprite have its own copy of the spritesheet, or do they share it. I assume that it is shared but I just wanted to make sure.

Thank you!

Seth
10-01-2009, 07:52 AM
So I included the offset_x and offset_y for each <Frame/> element in the XML document describing the sprite. Is it my imagination, or does the offset_x really dictate the movement as well.

The offset setting only changes where the sprite is drawn. Those .xml settings can also be modified from within the engine.

It doesn't change the animation speed or entity movement speed, but having it properly lined up does make it look better when an entity turns or such though.


Lets say I have a spritesheet. Is it efficient to have 8 animations on it? I mean would each sprite have its own copy of the spritesheet, or do they share it. I assume that it is shared but I just wanted to make sure.

Yep, the spritesheet is shared.