Class TileHitboxComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.tile.TileHitboxComponent
A component that is used the hitbox calculations of the tiles
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionTileHitboxComponent
(float maxPosX, float maxPosY, float minPosX, float minPosY) Constructor for the TileHitboxComponent -
Method Summary
Modifier and TypeMethodDescriptionfloat
float
float
float
boolean
inTileHitbox
(com.badlogic.gdx.math.GridPoint2 pos) Checks if the provided position is in the hitbox of the tilevoid
setMaxPosX
(float maxPosX) void
setMaxPosY
(float maxPosY) void
setMinPosX
(float minPosX) void
setMinPosY
(float minPosY) Methods inherited from class com.csse3200.game.components.Component
create, dispose, earlyUpdate, getEntity, getPriority, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
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 tilemaxPosY
- The highest y value of the tileminPosX
- The lowest x value of the tileminPosY
- 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)
-