Class TileHitboxComponent

java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.tile.TileHitboxComponent

public class TileHitboxComponent extends Component
A component that is used the hitbox calculations of the tiles
  • Constructor Details

    • TileHitboxComponent

      public TileHitboxComponent(float maxPosX, float maxPosY, float minPosX, float minPosY)
      Constructor for the TileHitboxComponent
      Parameters:
      maxPosX - The highest x value of the tile
      maxPosY - The highest y value of the tile
      minPosX - The lowest x value of the tile
      minPosY - The lowest y value of the tile
  • Method Details

    • getMaxPosX

      public float getMaxPosX()
    • getMaxPosY

      public float getMaxPosY()
    • getMinPosX

      public float getMinPosX()
    • getMinPosY

      public float getMinPosY()
    • setMaxPosX

      public void setMaxPosX(float maxPosX)
    • setMaxPosY

      public void setMaxPosY(float maxPosY)
    • setMinPosX

      public void setMinPosX(float minPosX)
    • setMinPosY

      public void setMinPosY(float minPosY)
    • inTileHitbox

      public boolean inTileHitbox(com.badlogic.gdx.math.GridPoint2 pos)
      Checks if the provided position is in the hitbox of the tile
      Parameters:
      pos - a GridPoint2 that contains the x and y of the point being checked
      Returns:
      a boolean depending on if the given point in the hitbox(true) or not(false)