From 89d474c0a232cf0f46c494f32198f351344cbc1c Mon Sep 17 00:00:00 2001 From: Matias Barandiaran <115642529+m4mbo@users.noreply.github.com> Date: Wed, 20 Mar 2024 15:38:27 +0100 Subject: [PATCH] Fixed range --- core/src/com/mygdx/Tools/EnemyController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/com/mygdx/Tools/EnemyController.java b/core/src/com/mygdx/Tools/EnemyController.java index 68590a5..77c2ffc 100644 --- a/core/src/com/mygdx/Tools/EnemyController.java +++ b/core/src/com/mygdx/Tools/EnemyController.java @@ -58,7 +58,7 @@ public void update() { Vector2 enemyPos = enemy.getPosition(); Vector2 playerPos = player.getPosition(); - if (MathWizard.inRange(enemyPos.x, playerPos.x, 20 / Constants.PPM)) { + if (MathWizard.inRange(enemyPos.x, playerPos.x, 16 / Constants.PPM)) { enemy.setMovementState(Constants.MSTATE.HSTILL); if (MathWizard.inRange(enemyPos.y, playerPos.y, 8 / Constants.PPM)) { ((ArmourGoblin) enemy).attack();