public class HitArea
extends java.lang.Object
| Constructor and Description |
|---|
HitArea()
The class constructor.
|
HitArea(HitArea hitArea)
The class constructor that initializes the hit determination area using
the specified data.
|
HitArea(int left,
int right,
int top,
int bottom)
The class constructor that initializes the hit determination area using
the specified values.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getBottom()
Returns the most bottom y coordinate of the hit box.
|
int |
getLeft()
Returns the most left x coordinate of the hit box.
|
int |
getRight()
Returns the most right x coordinate of the hit box.
|
int |
getTop()
Returns the most top y coordinate of the hit box.
|
void |
move(int speedX,
int speedY)
Updates the hit determination area's coordinates using the specified
speed.
|
public HitArea()
public HitArea(HitArea hitArea)
hitArea - an instance of the HitArea classpublic HitArea(int left,
int right,
int top,
int bottom)
left - the most left x coordinate of the hit boxright - the most right x coordinate of the hit boxtop - the most top y coordinate of the hit boxbottom - the most bottom y coordinate of the hit boxpublic void move(int speedX,
int speedY)
speedX - the horizontal speedspeedY - the vertical speedpublic int getLeft()
public int getRight()
public int getTop()
public int getBottom()