|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectDefender
public class Defender
A Lunar lander that can fire lasers
| Constructor Summary | |
|---|---|
Defender(int startX,
int startY,
java.lang.String imageName)
Constructs a Defender at the given location with the given image |
|
| Method Summary | |
|---|---|
Laser |
fireWeapon()
Return the bullet this Defender is about to fire. |
java.lang.String |
getImageName()
Returns the filename of this Defender's image |
int |
getXPosition()
Get the current x coordinate of the center of this Defender. |
int |
getYPosition()
Get the current y coordinate of the center of this Defender. |
boolean |
isHitByLaser(Laser theLaser)
Returns whether this Defender intersects this Laser |
void |
paint(java.awt.Graphics g)
Paint this Defender onto the given Graphics object |
void |
recordHit()
Updates the Object to record that it has been hit by a Laser. |
boolean |
removeMeFromGame()
Returns true if this Defender is dead. |
void |
setXPosition(int newXPosition)
Sets the x position to the given position |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Defender(int startX,
int startY,
java.lang.String imageName)
startX - the x position to start atstartY - the y position to start atimageName - the filename for the image to use| Method Detail |
|---|
public void setXPosition(int newXPosition)
newXPosition - public Laser fireWeapon()
public java.lang.String getImageName()
public int getXPosition()
public int getYPosition()
public boolean isHitByLaser(Laser theLaser)
theLaser -
public boolean removeMeFromGame()
public void recordHit()
public void paint(java.awt.Graphics g)
g - the Graphics object to draw onto
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||