despawn fix

This commit is contained in:
nora 2020-12-26 12:46:39 +01:00
parent cfbe965ec5
commit db584c83d4
4 changed files with 1 additions and 23 deletions

View file

@ -52,6 +52,6 @@ public class Coordinates {
public static boolean outOfBounds(Vector2D position, Vector2D size) {
return (position.x + size.magnitude() < 0 || position.x - size.magnitude() > Master.SCREEN_Y_COORDINATES * Master.SCREEN_RATIO ||
position.y + size.magnitude() < 0 || position.y - position.magnitude() > Master.SCREEN_Y_COORDINATES);
position.y + size.magnitude() < 0 || position.y - size.magnitude() > Master.SCREEN_Y_COORDINATES);
}
}

View file

@ -104,28 +104,6 @@ public abstract class GameObject implements Drawable {
g2d.fillOval((int) abs.x, (int) abs.y, (int) sizeAbs.x, (int) sizeAbs.y);
}
/**
* This method draws an oval at the current position and size with arguments
*
* @param g2d The Graphics2D object provided by the master
* @param arg Arguments like "center" for the object being drawn in the center
*/
public void drawOval(Graphics2D g2d, String arg) {
Vector2D abs;
if(arg.contains("center")){
abs = Coordinates.getWorldCoordinates(getCenterPosition());
} else {
abs = Coordinates.getWorldCoordinates(position);
}
Vector2D sizeAbs = Coordinates.getWorldCoordinates(size);
g2d.setPaint(mainColor);
g2d.drawOval((int) abs.x, (int) abs.y, (int) sizeAbs.x, (int) sizeAbs.y);
}
/**
* Destroy this {@code GameObject}
*/