public override void Update(GameTime gameTime) { if (Force == Vector2.Zero) { SourceRect = new Rectangle(0, 0, CurrentAnim.SpriteWidth, CurrentAnim.Animation.Height); } else { //wtf if (Force.Y < 0) { CurrentAnim = UpWalk; } if (Force.Y > 0) { CurrentAnim = DownWalk; } if (Force.X > 0) { CurrentAnim = RightWalk; } if (Force.X < 0) { CurrentAnim = LeftWalk; } SourceRect = CurrentAnim.Animate(gameTime, Delay); } }
protected Npc(CowGameScreen cowGameScreen, World world, Rectangle destRect, DynamicAnimatedSprites rightWalk, DynamicAnimatedSprites leftWalk, DynamicAnimatedSprites upWalk, DynamicAnimatedSprites downWalk) : base(cowGameScreen, world, destRect, rightWalk, leftWalk, upWalk, downWalk) { HaveWay = false; Standing = false; DamageAnimationTime = TimeSpan.FromMilliseconds(100); InAttack = false; }
protected Animal(CowGameScreen cowGameScreen, World world, Rectangle destRect, DynamicAnimatedSprites rightWalk, DynamicAnimatedSprites leftWalk, DynamicAnimatedSprites upWalk, DynamicAnimatedSprites downWalk) : base(cowGameScreen, world) { DestRect = destRect; RightWalk = rightWalk; LeftWalk = leftWalk; UpWalk = upWalk; DownWalk = downWalk; }