diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/IntVector2.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/IntVector2.java index f409a48..16493f3 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/IntVector2.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/IntVector2.java @@ -79,9 +79,7 @@ public class IntVector2 implements Serializable { } public IntVector2 sub(int x, int y) { - this.x -= x; - this.y -= y; - return this; + return new IntVector2(this.x - x, this.y - y); } public IntVector2 sub(IntVector2 v) { @@ -89,9 +87,7 @@ public class IntVector2 implements Serializable { } public IntVector2 add(int x, int y) { - this.x += x; - this.y += y; - return this; + return new IntVector2(this.x + x, this.y + y); } public IntVector2 add(IntVector2 v) { @@ -111,9 +107,7 @@ public class IntVector2 implements Serializable { } public IntVector2 scale(float x, float y) { - this.x *= x; - this.y *= y; - return this; + return new IntVector2((int)(this.x * x), (int)(this.y * y)); } public IntVector2 scale(float scalar) {