Added some getter/setter methods.
This commit is contained in:
parent
a8303ba13c
commit
07a36e01e4
@ -62,15 +62,20 @@ public class Ship extends BaseVectorShape {
|
|||||||
r = new Rectangle((int)getX() - 6, (int)getY() - 6, 12, 12);
|
r = new Rectangle((int)getX() - 6, (int)getY() - 6, 12, 12);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getAccelX() { return accelerateX; }
|
public double getAccelX() { return accelerateX; }
|
||||||
public double getAccelY() { return accelerateY; }
|
public double getAccelY() { return accelerateY; }
|
||||||
|
|
||||||
// Setter methods:
|
// Setter methods:
|
||||||
public void setAccelerate(boolean accel) { this.accelerate = accel; }
|
public void setAccelerate(boolean accel) { this.accelerate = accel; }
|
||||||
|
public void setAccelX(double aX) { this.accelerateX = aX; }
|
||||||
|
public void setAccelY(double aY) { this.accelerateY = aY; }
|
||||||
|
public void incAccelX(double iaX) { this.accelerateX += iaX; }
|
||||||
|
public void incAccelY(double iaY) { this.accelerateY += iaY; }
|
||||||
public void setTurnLeft(boolean tL) { this.turnLeft = tL; }
|
public void setTurnLeft(boolean tL) { this.turnLeft = tL; }
|
||||||
public void setTurnRight(boolean tR) { this.turnRight = tR; }
|
public void setTurnRight(boolean tR) { this.turnRight = tR; }
|
||||||
|
|
||||||
// Methods used for calculations:
|
// Methods used for calculations:
|
||||||
public double calcAngleMoveX(double angle) { return (double) (Math.cos(angle * Math.PI / 180)); }
|
public double calcAngleMoveX(double angle) { return (double) (Math.cos(angle * Math.PI / 180)); }
|
||||||
public double calcAngleMoveY(double angle) { return (double) (Math.sin(angle * Math.PI / 180)); }
|
public double calcAngleMoveY(double angle) { return (double) (Math.sin(angle * Math.PI / 180)); }
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user