Class Hero

java.lang.Object
  extended by Hero

public class Hero
extends Object

Protagonist or hero in the Dodge Defender Game. Make it to the other side and you get to the next level.

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

Field Summary
 int speedX
           
 int speedY
           
 
Constructor Summary
Hero()
          Constructor for Hero object, sets instance variables
 
Method Summary
 void die()
          Sets boolean flag condition to false.
 boolean getAlive()
          Returns condition of boolean flag alive.
 int getSpeedX()
          Returns horizontal speed.
 int getSpeedY()
          Returns vertical speed.
 int getX()
          Returns x cooridinate
 int getY()
          Returns y cooridinate
 void move()
          Adds speeds to x and y cooridinate, advancing their pixel position
 void setSpeedX(int xSpeed)
          Sets horizontal speed.
 void setSpeedY(int ySpeed)
          Sets vertical speed.
 void setX(int posX)
          Sets x cooridinate
 void setY(int posY)
          Sets y cooridinate
 void wrap()
          Makes hero wrap around screen.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

speedX

public int speedX

speedY

public int speedY
Constructor Detail

Hero

public Hero()
Constructor for Hero object, sets instance variables

Method Detail

die

public void die()
Sets boolean flag condition to false.


getAlive

public boolean getAlive()
Returns condition of boolean flag alive.


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()
Adds speeds to x and y cooridinate, advancing their pixel position


setSpeedX

public void setSpeedX(int xSpeed)
Sets horizontal speed.


setSpeedY

public void setSpeedY(int ySpeed)
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()
Makes hero wrap around screen. The hero never leaves the screen.