Browse Source

Added isWithin Function to Vector2

remotes/origin/menu
Julian 11 months ago
parent
commit
1638c71a00
  1. 8
      src/main/java/pacmanGame/Vector2.java

8
src/main/java/pacmanGame/Vector2.java

@ -29,6 +29,14 @@ public class Vector2 {
); );
} }
public boolean isWithin(Vector2 area) {
return this.x < area.x &&
this.y < area.y &&
this.x >= 0 &&
this.y >= 0
;
}
public Vector2 Clone() { public Vector2 Clone() {
return new Vector2(this.x, this.y); return new Vector2(this.x, this.y);
} }

Loading…
Cancel
Save