public void Update(Player player) { enemigoRect = new Rectangle((int)zombiePos.X, (int)zombiePos.Y, zombieText.Width, zombieText.Height); zombiePos.X = enemPosicion.X - 28; zombiePos.Y = enemPosicion.Y - 100; enemPosicion += velocity; playerDistanceX = player.posicion.X - enemPosicion.X; playerDistanceY = player.posicion.Y - enemPosicion.Y; siguiendo = true; caminar = true; helth.Update(player); acciones(player); }
public void Update(GameTime gameTime, Player player) { enemigoRect = new Rectangle((int)AvePos.X, (int)AvePos.Y, AveText.Width, AveText.Height); switch (Ataca) { case 1: if (player.posicion.X < AvePos.X) { AvePos.X -= 5; } else if (player.posicion.X > AvePos.X) { AvePos.X += 5; } if (player.posicion.X - AvePos.X < 10 && player.posicion.X - AvePos.X > -10) { if (player.posicion.Y - 100 < AvePos.Y) { AvePos.Y -= 10; } else if (player.posicion.Y - 100 >= AvePos.Y) { AvePos.Y += 10; } if (player.rectangulo_cuerpo.Intersects(enemigoRect)) { Ataca = 2; } } break; case 2: AvePos.X += 5; AvePos.Y -= 3; break; } health.Update(player); }
public void Update(Player player) { //animacionPlayer.PlayAnimation(caminar); enemPosicion += velocity; // DISTANCIA ENTRE ENEMIGO(RITCHER) Y LOBITO playerDistance = player.posicion.X - enemPosicion.X; // siguiendo = false; piso = false; caminando = false; enemigoRect = new Rectangle((int)enemPosicion.X - 20, (int)enemPosicion.Y - 80, starhitText.Width, starhitText.Height); acciones(player); health.Update(player); }