mirror of
https://github.com/Noratrieb/Java2DGame.git
synced 2026-01-14 22:15:01 +01:00
rotational testing
This commit is contained in:
parent
fa911f501e
commit
7e90017e8f
8 changed files with 41 additions and 30 deletions
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue