public class PlayerShip extends AbstractShip implements Shooter
Modifier and Type | Field and Description |
---|---|
static long |
coolDownTime |
static int |
healthPoints |
static java.lang.String |
imageLocation |
static double |
maxXVelocity |
static double |
maxYVelocity |
static double |
xAcceleration |
static double |
yAcceleration |
panel
Constructor and Description |
---|
PlayerShip()
This constructor sets HP and sprite locatoin from static game play values
|
Modifier and Type | Method and Description |
---|---|
void |
initializeLocation()
This mehod makes the player start at the center
|
void |
moveDirection()
This method makes the player directoin the same as the mouse
|
void |
movementKeyPressed(java.awt.event.KeyEvent keyEvent)
This method handles key controls for movement.
|
void |
movementKeyReleased(java.awt.event.KeyEvent keyEvent)
This method handles key controls for stoppig movement.
|
void |
shoot()
This method is responisble for firing bullets.
|
boolean |
timeToShoot()
This method checks if it's time for the shooter to shoot or if it's still cooling down.
|
movePosition
draw, getCenter, getDirection, getHealthPoints, getHeight, getImage, getPosition, getWidth, getXCenter, getXDirection, getXPosition, getXVelocity, getYCenter, getYDirection, getYPosition, getYVelocity, gotHit, isDead, makeDead, move, setDirection, setDirectionToward, setHealthPoints, setImage, setImageLocation, setPosition, setXDirection, setXPosition, setXVelocity, setYDirection, setYPosition, setYVelocity
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
draw, getCenter, getDirection, getHealthPoints, getHeight, getImage, getPosition, getWidth, getXCenter, getXDirection, getXPosition, getXVelocity, getYCenter, getYDirection, getYPosition, getYVelocity, gotHit, isDead, makeDead, move, movePosition, setDirection, setDirectionToward, setHealthPoints, setImage, setImageLocation, setPosition, setXDirection, setXPosition, setXVelocity, setYDirection, setYPosition, setYVelocity
public static java.lang.String imageLocation
public static long coolDownTime
public static double xAcceleration
public static double yAcceleration
public static double maxXVelocity
public static double maxYVelocity
public static int healthPoints
public PlayerShip()
public void initializeLocation()
initializeLocation
in interface GameObject
initializeLocation
in class AbstractShip
public void moveDirection()
moveDirection
in interface GameObject
moveDirection
in class AbstractShip
public void movementKeyPressed(java.awt.event.KeyEvent keyEvent)
keyEvent
- the key eventpublic void movementKeyReleased(java.awt.event.KeyEvent keyEvent)
keyEvent
- the key eventpublic void shoot()
public boolean timeToShoot()
Shooter
timeToShoot
in interface Shooter