mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 10:18:01 +00:00
Update EnemySprite.java
This commit is contained in:
@@ -53,8 +53,7 @@ public class EnemySprite extends CharacterSprite {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void moveTo(Actor other, float delta) {
|
public void moveTo(Actor other, float delta) {
|
||||||
float scale = this instanceof EnemySprite ? 2f :1f;
|
Vector2 diff = new Vector2(other.getX(), other.getY()).sub(pos());
|
||||||
Vector2 diff = new Vector2(other.getX()*scale, other.getY()*scale).sub(pos());
|
|
||||||
|
|
||||||
diff.setLength(data.speed*delta);
|
diff.setLength(data.speed*delta);
|
||||||
moveBy(diff.x, diff.y);
|
moveBy(diff.x, diff.y);
|
||||||
|
|||||||
Reference in New Issue
Block a user