public class UFO
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
FAST_SHIP |
static int |
SIMPLE_SAUCER |
static int |
SUPER_SAUCER |
Constructor and Description |
---|
UFO(int startX,
int startY,
int uFOType)
Constructs an UFO object given its type and initial position
|
Modifier and Type | Method and Description |
---|---|
Laser |
fireWeapon(Defender defender)
Return the bullet this UFO is about to fire.
|
int |
getUFOType()
Get an int represented the type for this UFO
|
int |
getXPosition()
Get the current x coordinate of the center of this UFO.
|
int |
getYPosition()
Get the current y coordinate of the center of this UFO.
|
boolean |
isHitByLaser(Laser theLaser)
Returns whether this UFO intersects this Laser
|
void |
recordHit()
Updates the Object to record that it has been hit by a Laser.
|
boolean |
removeMeFromGame()
Returns true if this UFO has been destroyed.
|
boolean |
shootsThisTurn(Defender defender)
Return true if this UFO fires this during this tick.
|
void |
takeOneStep(Defender defender)
Updates the position of the UFO for the next time it is redrawn.
|
public static final int SIMPLE_SAUCER
public static final int FAST_SHIP
public static final int SUPER_SAUCER
public UFO(int startX, int startY, int uFOType)
startX
- initial x coordinatestartY
- initial y coordinateuFOType
- int representing the type of UFO this is.public int getXPosition()
public int getYPosition()
public int getUFOType()
public void takeOneStep(Defender defender)
defender
- The Defender object. Ignore for now, but it may
be used in challege task to determine movement some UFO types.public boolean shootsThisTurn(Defender defender)
defender
- The Defender object. Ignore for now, but it may
be used in challege task to determine firing for some UFO types.public Laser fireWeapon(Defender defender)
defender
- The Defender object. Ignore for now, but it may
be used in challege task to determine firing for some UFO types.public boolean isHitByLaser(Laser theLaser)
theLaser
- public void recordHit()
public boolean removeMeFromGame()