Package struct
Class HitArea
java.lang.Object
struct.HitArea
The class dealing with information on the area of the character and the
attack hit box.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionintReturns the most bottom y coordinate of the hit box.intgetLeft()Returns the most left x coordinate of the hit box.intgetRight()Returns the most right x coordinate of the hit box.intgetTop()Returns the most top y coordinate of the hit box.voidmove(int speedX, int speedY) Updates the hit determination area's coordinates using the specified speed.
-
Field Details
-
left
private int leftThe most left x coordinate of the hit box. -
right
private int rightThe most right x coordinate of the hit box. -
top
private int topThe most top y coordinate of the hit box. -
bottom
private int bottomThe most bottom y coordinate of the hit box.
-
-
Method Details
-
move
public void move(int speedX, int speedY) Updates the hit determination area's coordinates using the specified speed.- Parameters:
speedX- the horizontal speedspeedY- the vertical speed
-
getLeft
public int getLeft()Returns the most left x coordinate of the hit box.- Returns:
- the most left x coordinate of the hit box
-
getRight
public int getRight()Returns the most right x coordinate of the hit box.- Returns:
- the most right x coordinate of the hit box
-
getTop
public int getTop()Returns the most top y coordinate of the hit box.- Returns:
- the most top y coordinate of the hit box
-
getBottom
public int getBottom()Returns the most bottom y coordinate of the hit box.- Returns:
- the most bottom y coordinate of the hit box
-