rotational testing

This commit is contained in:
nora 2020-12-30 15:48:07 +01:00
parent fa911f501e
commit 7e90017e8f
8 changed files with 41 additions and 30 deletions

View file

@ -1,6 +1,7 @@
package objects.ships;
import core.general.Input;
import core.general.Master;
import core.math.Coordinates;
import core.math.ExMath;
import core.math.Vector2D;
@ -40,11 +41,13 @@ public class Turret extends GameObject {
int xCenterAbs = (int) (abs.x + sizeAbs / 2);
int yCenterAbs = (int) (abs.y + sizeAbs / 2);
Master.debugPos(getMapCoords(position), 1);
g2d.rotate(rotation, xCenterAbs, yCenterAbs);
g2d.fillOval((int) abs.x, (int) abs.y, sizeAbs, sizeAbs);
master.debugPos(abs, 1000);
Master.debugPos(abs, 1000);
//BARRELS---------------------------------------
g2d.setStroke(new BasicStroke((int) Coordinates.getWorldCoordinates(new Vector2D(object.getSize().x / barrelAmount / BARREL_THICKNESS, 0)).x, BasicStroke.CAP_BUTT,
@ -74,6 +77,8 @@ public class Turret extends GameObject {
@Override
public void update() {
//TODO fix with everything haha
Point msLoc = master.getMouseLocation();
Vector2D mouseRel = Coordinates.getMapCoordinatesFromWorld(Vector2D.fromPoint(msLoc)); //100 correct
Vector2D centerMap = getMapCoords(getCenterPosition());