public override void Update(GameTime gametime) { walkingAnimationTimer += (float)gametime.ElapsedGameTime.TotalMilliseconds; hitAnimationTimer += (float)gametime.ElapsedGameTime.TotalMilliseconds; if (alive) { this.sourceRectangle = new Rectangle(WIDTH * WalkingFrame, 0, WIDTH, HEIGHT); this.hitSourceRectangle = new Rectangle(WIDTH * HitFrame, 80, WIDTH, HEIGHT); if (Vector2.Distance(this.Position, targetPosition) <= 50) { this.velocity = Vector2.Zero; this.Position = new Vector2(0, 0); } else { this.velocity = AIMovement.MoveTowards(this.Position, targetPosition) * SPEED * (float)gametime.ElapsedGameTime.TotalMilliseconds; UpdateRotation(); WalkingAnimation(ref walkingAnimationTimer); HitAmimation(ref hitAnimationTimer); } if (this.health <= 0) { Alive = false; } this.Position += velocity; this.bloodPosition = position; //HIT POINT FLASH DISPLAY this.damagePosition = new Vector2(this.BoundingBox.X + randomDamageOffset, this.BoundingBox.Y + damageDisplayIncretment); if (displayingDamagePoints) { damageDisplayIncretment -= 2f; if (damageDisplayIncretment < -100f) { displayingDamagePoints = false; damageDisplayIncretment = 0f; } } // HIT POINT FLASH DISPLAY ZombieGroan(gametime); } else if (!alive) { DeathAnmationTimer -= (float)gametime.ElapsedGameTime.TotalMilliseconds; if (DeathAnmationTimer <= 0) { DeathFrame++; DeathAnmationTimer = 50f; } if (DeathFrame >= 11) { DeathFrame = 11; } } }