|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectHero
public class Hero
Protagonist or hero in the Dodge Defender Game. Make it to the other side and you get to the next level.
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 |
---|
public int speedX
public int speedY
Constructor Detail |
---|
public Hero()
Method Detail |
---|
public void die()
public boolean getAlive()
public int getSpeedX()
public int getSpeedY()
public int getX()
public int getY()
public void move()
public void setSpeedX(int xSpeed)
public void setSpeedY(int ySpeed)
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 |