Class Enemy

java.lang.Object
  extended by Enemy

public class Enemy
extends Object

Serves as the enemy in Dodge Defender. The hero will not touch the enemy who go at various speeds and start at various places.

Version:
1.10 09 Apr 2013
Author:
Max Biel history: !!! xxx 09apr2013: Started Class

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

Enemy

public Enemy()
Third constructor setting everything to default.


Enemy

public Enemy(int r)
Second constructor allowing only radius to be set.


Enemy

public Enemy(int positionY,
             int velocX,
             int velocY)
First constructor allowing most parameters to be set.

Method Detail

getRadius

public int getRadius()
Returns radius.


getSpeedX

public int getSpeedX()
Returns horizontal speed.


getSpeedY

public int getSpeedY()
Returns vertical speed.


getX

public int getX()
Returns x cooridinate.


getY

public int getY()
Returns y cooridinate.


move

public void move()
Changes x and y based on their vertical and horizontal speed, effectively moving them.


setRadius

public void setRadius(int r)
Sets radius.


setSpeedX

public void setSpeedX(int velocX)
Sets horizontal speed.


setSpeedY

public void setSpeedY(int velocY)
Sets vertical speed.


setX

public void setX(int posX)
Sets x cooridinate.


setY

public void setY(int posY)
Sets y cooridinate.


wrap

public void wrap()
Keeps all enemys on the screen so they wrap around the plain.