Package struct

Class HitArea

java.lang.Object
struct.HitArea

public class HitArea extends Object
The class dealing with information on the area of the character and the attack hit box.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private int
    The most bottom y coordinate of the hit box.
    private int
    The most left x coordinate of the hit box.
    private int
    The most right x coordinate of the hit box.
    private int
    The most top y coordinate of the hit box.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the most bottom y coordinate of the hit box.
    int
    Returns the most left x coordinate of the hit box.
    int
    Returns the most right x coordinate of the hit box.
    int
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • left

      private int left
      The most left x coordinate of the hit box.
    • top

      private int top
      The most top y coordinate of the hit box.
    • bottom

      private int bottom
      The 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 speed
      speedY - 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