mirror of
https://github.com/Noratrieb/Java2DGame.git
synced 2026-01-14 22:15:01 +01:00
no useless parameters
This commit is contained in:
parent
e841bb4188
commit
70610c7c53
18 changed files with 27 additions and 45 deletions
|
|
@ -1,6 +1,5 @@
|
|||
package objects.ships;
|
||||
|
||||
import core.Master;
|
||||
import objects.GameObject;
|
||||
|
||||
import java.awt.*;
|
||||
|
|
@ -27,10 +26,10 @@ public class BattleShip extends GameObject {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void draw(Graphics2D g2d, int w, Master master) {
|
||||
public void draw(Graphics2D g2d) {
|
||||
|
||||
drawRoundRect(g2d, w, w/10, w/10);
|
||||
turrets.forEach((turret -> turret.draw(g2d, w, master)));
|
||||
drawRoundRect(g2d, master.getW()/10, master.getW()/10);
|
||||
turrets.forEach((turret -> turret.draw(g2d)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package objects.ships;
|
||||
|
||||
import core.Master;
|
||||
import core.math.Vector2D;
|
||||
import objects.GameObject;
|
||||
|
||||
|
|
@ -15,7 +14,7 @@ public class Shell extends GameObject {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void draw(Graphics2D g2d, int w, Master master) {
|
||||
public void draw(Graphics2D g2d) {
|
||||
g2d.setPaint(Color.orange);
|
||||
g2d.fillOval((int) position.x, (int) position.y, (int) size.x, (int) size.y);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package objects.ships;
|
||||
|
||||
import core.Coords;
|
||||
import core.Master;
|
||||
import core.math.Vector2D;
|
||||
import core.physics.Collidable;
|
||||
import core.physics.Hitbox;
|
||||
|
|
@ -21,9 +20,9 @@ public class Submarine extends GameObject implements Collidable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void draw(Graphics2D g2d, int w, Master master) {
|
||||
public void draw(Graphics2D g2d) {
|
||||
g2d.setPaint(Color.BLUE);
|
||||
drawOval(g2d, w);
|
||||
drawOval(g2d);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package objects.ships;
|
||||
|
||||
import core.math.ExMath;
|
||||
import core.Master;
|
||||
import core.math.Vector2D;
|
||||
import objects.GameObject;
|
||||
|
||||
|
|
@ -42,8 +41,7 @@ public class Turret extends GameObject {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void draw(Graphics2D g2d, int w, Master master) {
|
||||
h = w / 16 * 9;
|
||||
public void draw(Graphics2D g2d) {
|
||||
g2d.setPaint(mainColor);
|
||||
Vector2D abs = battleShip.getWorldCoordsFromLocal(position);
|
||||
int sizeAbs = (int) battleShip.getWorldCoordsFromLocalSize(size).x;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue