|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectEnemy
public class Enemy
Serves as the enemy in Dodge Defender. The hero will not touch the enemy who go at various speeds and start at various places.
Constructor Summary | |
---|---|
Enemy()
Third constructor setting everything to default. |
|
Enemy(int r)
Second constructor allowing only radius to be set. |
|
Enemy(int positionY,
int velocX,
int velocY)
First constructor allowing most parameters to be set. |
Method Summary | |
---|---|
int |
getRadius()
Returns radius. |
int |
getSpeedX()
Returns horizontal speed. |
int |
getSpeedY()
Returns vertical speed. |
int |
getX()
Returns x cooridinate. |
int |
getY()
Returns y cooridinate. |
void |
move()
Changes x and y based on their vertical and horizontal speed, effectively moving them. |
void |
setRadius(int r)
Sets radius. |
void |
setSpeedX(int velocX)
Sets horizontal speed. |
void |
setSpeedY(int velocY)
Sets vertical speed. |
void |
setX(int posX)
Sets x cooridinate. |
void |
setY(int posY)
Sets y cooridinate. |
void |
wrap()
Keeps all enemys on the screen so they wrap around the plain. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Enemy()
public Enemy(int r)
public Enemy(int positionY, int velocX, int velocY)
Method Detail |
---|
public int getRadius()
public int getSpeedX()
public int getSpeedY()
public int getX()
public int getY()
public void move()
public void setRadius(int r)
public void setSpeedX(int velocX)
public void setSpeedY(int velocY)
public void setX(int posX)
public void setY(int posY)
public void wrap()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |