first sorry for the bad english. I'm using LPC Graphics, I added the 13 side frames and it works perfectly, even the paperdoll works. the problem is that the attack, shoot, cast animations only move 4 frames. the animation when walking works perfectly and the idle too.
Sprite Draw:
Reveal hidden contents
if (Options.AnimatedSprites.Contains(sprite.ToLower()))
{
srcRectangle = new FloatRect(
AnimationFrame * (int)texture.GetWidth() / 13, d * (int)texture.GetHeight() / 4,
(int)texture.GetWidth() / 13, (int)texture.GetHeight() / 4
);
}
else
{
if (SpriteAnimation == SpriteAnimations.Normal)
{
var attackTime = CalculateAttackTime();
if (AttackTimer - CalculateAttackTime() / 2 > Globals.System.GetTimeMs() || Blocking)
{
srcRectangle = new FloatRect(
3 * (int)texture.GetWidth() / 13, d * (int)texture.GetHeight() / 4,
(int)texture.GetWidth() / 13, (int)texture.GetHeight() / 4
);
}
else
{
//Restore Original Attacking/Blocking Code
srcRectangle = new FloatRect(
WalkFrame * (int) texture.GetWidth() / 13, d * (int) texture.GetHeight() / 4,
(int) texture.GetWidth() / 13, (int) texture.GetHeight() / 4
);
}
}
else
{
srcRectangle = new FloatRect(
SpriteFrame * (int)texture.GetWidth() / 13, d * (int)texture.GetHeight() / 4,
(int)texture.GetWidth() / 13, (int)texture.GetHeight() / 4
);
}
}
Other modifications:
Reveal hidden contents
destRectangle.X -= texture.GetWidth() / 26;
if (IsMoving)
{
WalkFrame++;
if (WalkFrame >= 13)
{
WalkFrame = 0;
}
}
Question
corrupted
first sorry for the bad english. I'm using LPC Graphics, I added the 13 side frames and it works perfectly, even the paperdoll works. the problem is that the attack, shoot, cast animations only move 4 frames. the animation when walking works perfectly and the idle too.
Sprite Draw:
if (Options.AnimatedSprites.Contains(sprite.ToLower()))
{
srcRectangle = new FloatRect(
AnimationFrame * (int)texture.GetWidth() / 13, d * (int)texture.GetHeight() / 4,
(int)texture.GetWidth() / 13, (int)texture.GetHeight() / 4
);
}
else
{
if (SpriteAnimation == SpriteAnimations.Normal)
{
var attackTime = CalculateAttackTime();
if (AttackTimer - CalculateAttackTime() / 2 > Globals.System.GetTimeMs() || Blocking)
{
srcRectangle = new FloatRect(
3 * (int)texture.GetWidth() / 13, d * (int)texture.GetHeight() / 4,
(int)texture.GetWidth() / 13, (int)texture.GetHeight() / 4
);
}
else
{
//Restore Original Attacking/Blocking Code
srcRectangle = new FloatRect(
WalkFrame * (int) texture.GetWidth() / 13, d * (int) texture.GetHeight() / 4,
(int) texture.GetWidth() / 13, (int) texture.GetHeight() / 4
);
}
}
else
{
srcRectangle = new FloatRect(
SpriteFrame * (int)texture.GetWidth() / 13, d * (int)texture.GetHeight() / 4,
(int)texture.GetWidth() / 13, (int)texture.GetHeight() / 4
);
}
}
Other modifications:
destRectangle.X -= texture.GetWidth() / 26;
if (IsMoving)
{
WalkFrame++;
if (WalkFrame >= 13)
{
WalkFrame = 0;
}
}
if (AnimationTimer < Globals.System.GetTimeMs())
{
AnimationTimer = Globals.System.GetTimeMs() + 2000;
AnimationFrame++;
if (AnimationFrame >= 13)
{
AnimationFrame = 0;
}
}
Link to comment
Share on other sites
10 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now