private void MoveControl(GameTime gametime) { if (right == true) { velocity.X = 1.33f; AnimWalk.Update(gametime); } if (left == true) { velocity.X = -1.3f; AnimWalk.Update(gametime); } if (runright == true) { velocity.X = 2f; AnimRun.Update(gametime); } if (runleft == true) { velocity.X = -2f; AnimRun.Update(gametime); } if (bark == true) { velocity.X = 0; velocity.Y = 0; AnimBark.Update(gametime); } if (pee == true) { velocity.X = 0; velocity.Y = 0; AnimPee.Update(gametime); } if (flip == true) { AnimFlip.Update(gametime); } if (jumped == true) { AnimJump.Update(gametime); } else { animation = AnimIdle; AnimIdle.Update(gametime); } }
private void SetAnimation(Animation anim, bool loop = true) { if (customAnimPlaying || anim == null || Animation == anim || anim.FrameCount == 0) { return; } Animation = anim; if (loop) { Animation.Start(); } else { AnimJump.Start(1); } }