Tweak the running visuals

This commit is contained in:
VoxelDoesCode 2022-10-08 16:07:15 -04:00
parent c0fe997a39
commit fc09212d43
2 changed files with 29 additions and 27 deletions

View file

@ -501,50 +501,52 @@ anim.front_foot.frames.Add(AnimKeyframe(0.8, 8, 0, 0))
anim.front_foot.frames.Add(AnimKeyframe(1.0,-10,-4, 0.2))
container.animations.Add(anim)
# the run_left animation is taken directly from run_right, only the x and rotate values are flipped,
# and each string is run backwards, to account for how it's played in game.
anim = Animation("run_left")
anim.body.frames.Add(AnimKeyframe(0.0, 0, -2, 0))
anim.body.frames.Add(AnimKeyframe(0.0, 0, -1, 0))
anim.body.frames.Add(AnimKeyframe(0.2, 0, 0, 0))
anim.body.frames.Add(AnimKeyframe(0.4, 0, 0, 0))
anim.body.frames.Add(AnimKeyframe(0.6, 0, -2, 0))
anim.body.frames.Add(AnimKeyframe(0.4, 0, -1, 0))
anim.body.frames.Add(AnimKeyframe(0.6, 0, 0, 0))
anim.body.frames.Add(AnimKeyframe(0.8, 0, 0, 0))
anim.body.frames.Add(AnimKeyframe(1.0, 0, -2, 0))
anim.body.frames.Add(AnimKeyframe(1.0, 0, -1, 0))
anim.back_foot.frames.Add(AnimKeyframe(0.0, 18, -11, -0.27))
anim.back_foot.frames.Add(AnimKeyframe(0.0, 18, -8, -0.27))
anim.back_foot.frames.Add(AnimKeyframe(0.2, 6, 0, 0))
anim.back_foot.frames.Add(AnimKeyframe(0.4, -7, 0, 0))
anim.back_foot.frames.Add(AnimKeyframe(0.6, -13, -4.5, 0.05))
anim.back_foot.frames.Add(AnimKeyframe(0.8, 0, -11, -0.2))
anim.back_foot.frames.Add(AnimKeyframe(1.0, 18, -11, -0.27))
anim.back_foot.frames.Add(AnimKeyframe(0.8, 0, -8, -0.2))
anim.back_foot.frames.Add(AnimKeyframe(1.0, 18, -8, -0.27))
anim.front_foot.frames.Add(AnimKeyframe(0.0, -13, -4.5, 0.05))
anim.front_foot.frames.Add(AnimKeyframe(0.2, -14, -7, 0.1))
anim.front_foot.frames.Add(AnimKeyframe(0.4, 11, -13, -0.3))
anim.front_foot.frames.Add(AnimKeyframe(0.6, 18, -11, -0.27))
anim.front_foot.frames.Add(AnimKeyframe(0.8, 3, 0, -0.02))
anim.front_foot.frames.Add(AnimKeyframe(1.0, -13, -4.5, 0.05))
anim.front_foot.frames.Add(AnimKeyframe(0.0, -11, -2.5, 0.05))
anim.front_foot.frames.Add(AnimKeyframe(0.2, -14, -5, 0.1))
anim.front_foot.frames.Add(AnimKeyframe(0.4, 11, -8, -0.3))
anim.front_foot.frames.Add(AnimKeyframe(0.6, 18, -8, -0.27))
anim.front_foot.frames.Add(AnimKeyframe(0.8, 3, 0, 0))
anim.front_foot.frames.Add(AnimKeyframe(1.0, -11, -2.5, 0.05))
container.animations.Add(anim)
anim = Animation("run_right")
anim.body.frames.Add(AnimKeyframe(0.0, 0, -2, 0))
anim.body.frames.Add(AnimKeyframe(0.0, 0, -1, 0))
anim.body.frames.Add(AnimKeyframe(0.2, 0, 0, 0))
anim.body.frames.Add(AnimKeyframe(0.4, 0, -2, 0))
anim.body.frames.Add(AnimKeyframe(0.6, 0, 0, 0))
anim.body.frames.Add(AnimKeyframe(0.4, 0, 0, 0))
anim.body.frames.Add(AnimKeyframe(0.6, 0, -1, 0))
anim.body.frames.Add(AnimKeyframe(0.8, 0, 0, 0))
anim.body.frames.Add(AnimKeyframe(1.0, 0, -2, 0))
anim.body.frames.Add(AnimKeyframe(1.0, 0, -1, 0))
anim.back_foot.frames.Add(AnimKeyframe(0.0, -18, -11, 0.27))
anim.back_foot.frames.Add(AnimKeyframe(0.2, 0, -11, 0.2))
anim.back_foot.frames.Add(AnimKeyframe(0.0, -18, -8, 0.27))
anim.back_foot.frames.Add(AnimKeyframe(0.2, 0, -8, 0.2))
anim.back_foot.frames.Add(AnimKeyframe(0.4, 13, -4.5, -0.05))
anim.back_foot.frames.Add(AnimKeyframe(0.6, 7, 0, 0))
anim.back_foot.frames.Add(AnimKeyframe(0.8, -6, 0, 0))
anim.back_foot.frames.Add(AnimKeyframe(1.0, -18, -11, 0.27))
anim.back_foot.frames.Add(AnimKeyframe(1.0, -18, -8, 0.27))
anim.front_foot.frames.Add(AnimKeyframe(0.0, 13, -4.5, -0.05))
anim.front_foot.frames.Add(AnimKeyframe(0.2, -3, 0, 0.02))
anim.front_foot.frames.Add(AnimKeyframe(0.4, -18, -11, 0.27))
anim.front_foot.frames.Add(AnimKeyframe(0.6, -11, -13, 0.3))
anim.front_foot.frames.Add(AnimKeyframe(0.8, 14, -7, -0.1))
anim.front_foot.frames.Add(AnimKeyframe(1.0, 13, -4.5, -0.05))
anim.front_foot.frames.Add(AnimKeyframe(0.0, 11, -2.5, -0.05))
anim.front_foot.frames.Add(AnimKeyframe(0.2, -3, 0, 0))
anim.front_foot.frames.Add(AnimKeyframe(0.4, -18, -8, 0.27))
anim.front_foot.frames.Add(AnimKeyframe(0.6, -11, -8, 0.3))
anim.front_foot.frames.Add(AnimKeyframe(0.8, 14, -5, -0.1))
anim.front_foot.frames.Add(AnimKeyframe(1.0, 11, -2.5, -0.05))
container.animations.Add(anim)
anim = Animation("hammer_swing")

View file

@ -420,7 +420,7 @@ void CPlayers::RenderPlayer(
// evaluate animation
float WalkTime = fmod(Position.x, 100.0f) / 100.0f;
float RunTime = fmod(Position.x, 250.0f) / 250.0f;
float RunTime = fmod(Position.x, 200.0f) / 200.0f;
// Don't do a moon walk outside the left border
if(WalkTime < 0)