15 Replies - 4073 Views - Last Post: 04 November 2010 - 02:12 PM
#1
Animating a sprite, incredibly fustrated
Posted 13 October 2010 - 06:27 AM
Replies To: Animating a sprite, incredibly fustrated
#2
Re: Animating a sprite, incredibly fustrated
Posted 13 October 2010 - 06:38 AM
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
#3
Re: Animating a sprite, incredibly fustrated
Posted 13 October 2010 - 10:59 AM
#4
Re: Animating a sprite, incredibly fustrated
Posted 13 October 2010 - 02:03 PM
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.
#5
Re: Animating a sprite, incredibly fustrated
Posted 13 October 2010 - 03:22 PM
Shane Hudson, on 13 October 2010 - 01:03 PM, said:
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
#6
Re: Animating a sprite, incredibly fustrated
Posted 13 October 2010 - 06:39 PM
#7
Re: Animating a sprite, incredibly fustrated
Posted 14 October 2010 - 08:01 AM
#8
Re: Animating a sprite, incredibly fustrated
Posted 14 October 2010 - 08:03 AM
#9
Re: Animating a sprite, incredibly fustrated
Posted 14 October 2010 - 05:20 PM
#10
Re: Animating a sprite, incredibly fustrated
Posted 14 October 2010 - 06:00 PM
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
#11
Re: Animating a sprite, incredibly fustrated
Posted 15 October 2010 - 10:09 AM
This post has been edited by Kilorn: 15 October 2010 - 10:12 AM
#12
Re: Animating a sprite, incredibly fustrated
Posted 15 October 2010 - 11:23 AM
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
#13
Re: Animating a sprite, incredibly fustrated
Posted 19 October 2010 - 08:20 PM
bonyjoe, on 15 October 2010 - 10:23 AM, said:
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
#14
Re: Animating a sprite, incredibly fustrated
Posted 19 October 2010 - 08:42 PM
This post has been edited by Kilorn: 19 October 2010 - 08:43 PM
#15
Re: Animating a sprite, incredibly fustrated
Posted 01 November 2010 - 07:16 AM
http://www.dreaminco...nimated-sprite/
|
|

New Topic/Question
Reply



MultiQuote







|