Skip to content

Commit

Permalink
Merge pull request #29 from m4mbo/enemy-bug
Browse files Browse the repository at this point in the history
Fixed range
  • Loading branch information
m4mbo committed Mar 20, 2024
2 parents 726b2dc + 89d474c commit 40aa2eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/com/mygdx/Tools/EnemyController.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 40aa2eb

Please sign in to comment.