public class SpaceShip
extends java.awt.Polygon
GameBoard
,
Serialized FormModifier and Type | Field and Description |
---|---|
private double |
centerX |
private double |
centerY |
(package private) int |
gameBoardHeight |
(package private) int |
gameBoardWidth |
static boolean |
interaction |
private double |
movingAngle |
static int[] |
polyXArray |
static int[] |
polyYArray |
private double |
rotationAngle |
private int |
shipHeight |
private int |
shipWidth |
private double |
uLeftXPos |
private double |
uLeftYPos |
private double |
xVelocity |
private double |
yVelocity |
Constructor and Description |
---|
SpaceShip() |
Modifier and Type | Method and Description |
---|---|
void |
decreaseRotationAngle()
Used to rotate the ship counter-clockwise by 5 degrees.
|
void |
decreaseXVelocity(double decreaseAmount) |
void |
decreaseYVelocity(double decreaseAmount) |
java.awt.Rectangle |
getBounds() |
double |
getMovingAngle() |
double |
getRotationAngle() |
int |
getShipHeight() |
double |
getShipNoseX() |
double |
getShipNoseY() |
int |
getShipWidth() |
double |
getULeftXPos() |
double |
getULeftYPos() |
double |
getXCenter() |
double |
getXVelocity() |
double |
getYCenter() |
double |
getYVelocity() |
void |
increaseMovingAngle(double moveAngle) |
void |
increaseRotationAngle()
Used to rotate the ship clockwise by 5 degrees.
|
void |
increaseXPosition(double increaseAmount) |
void |
increaseXVelocity(double increaseAmount) |
void |
increaseYPosition(double increaseAmount) |
void |
increaseYVelocity(double increaseAmount) |
void |
move()
Used to move the space ship around the screen.
|
void |
setMovingAngle(double moveAngle) |
void |
setULeftXPos(double uLXPos) |
void |
setULeftYPos(double uLYPos) |
void |
setXCenter(double xCenter) |
void |
setXVelocity(double xVel) |
void |
setYCenter(double yCenter) |
void |
setYVelocity(double yVel) |
double |
shipXMoveAngle(double xMoveAngle) |
double |
shipYMoveAngle(double yMoveAngle) |
void |
stopShip()
Stops the ships movement in place.
|
private double xVelocity
private double yVelocity
int gameBoardWidth
int gameBoardHeight
private double centerX
private double centerY
public static int[] polyXArray
public static int[] polyYArray
private int shipWidth
private int shipHeight
private double uLeftXPos
private double uLeftYPos
private double rotationAngle
private double movingAngle
public static boolean interaction
public double getXCenter()
public double getYCenter()
public void setXCenter(double xCenter)
public void setYCenter(double yCenter)
public double getULeftXPos()
public double getULeftYPos()
public void setULeftXPos(double uLXPos)
public void setULeftYPos(double uLYPos)
public int getShipWidth()
public int getShipHeight()
public double getXVelocity()
public double getYVelocity()
public void setXVelocity(double xVel)
public void setYVelocity(double yVel)
public void setMovingAngle(double moveAngle)
public double getMovingAngle()
public double getRotationAngle()
public void increaseXPosition(double increaseAmount)
public void increaseYPosition(double increaseAmount)
public void increaseXVelocity(double increaseAmount)
public void increaseYVelocity(double increaseAmount)
public void decreaseXVelocity(double decreaseAmount)
public void decreaseYVelocity(double decreaseAmount)
public void increaseMovingAngle(double moveAngle)
public void stopShip()
public double shipXMoveAngle(double xMoveAngle)
public double shipYMoveAngle(double yMoveAngle)
public void increaseRotationAngle()
public void decreaseRotationAngle()
public java.awt.Rectangle getBounds()
getBounds
in interface java.awt.Shape
getBounds
in class java.awt.Polygon
Polygon.getBounds()
public double getShipNoseX()
public double getShipNoseY()
public void move()