32 lines
560 B
Java
32 lines
560 B
Java
|
|
public class Turret extends MovingObject
|
|
{
|
|
private MovingObject parent;
|
|
private Shape shape;
|
|
public Turret(float x, float y)
|
|
{
|
|
super();
|
|
this.x = x;
|
|
this.y = y;
|
|
this.setShape(new Shape(Shape.S_TURRET)); // stand vorher S_Geschütz
|
|
this.getShape().setSize(1f);
|
|
}
|
|
public void setParent(MovingObject p)
|
|
{
|
|
this.parent = p;
|
|
}
|
|
public MovingObject getParent()
|
|
{
|
|
return this.parent;
|
|
}
|
|
@Override
|
|
public void move(float delta, boolean keepOnScreen)
|
|
{
|
|
if(this.parent!=null)
|
|
{
|
|
this.x = parent.getX();
|
|
this.y = parent.getY();
|
|
}
|
|
}
|
|
}
|