Class MazeMovementUtils
java.lang.Object
com.csse3200.game.minigames.maze.components.tasks.MazeMovementUtils
Some utility functions to help with movement tasks in the maze.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic com.badlogic.gdx.math.Vector2
Takes a position relative to the center of an entity and converts it to a position relative to the bottom-left corner of the entity.static boolean
canBeeLineTo
(com.badlogic.gdx.math.Vector2 pos, Entity entity) Checks whether an entity can beeline to a position considering hitbox collisions and obstacles.static com.badlogic.gdx.math.Vector2[]
getHitBoxCorners
(Entity entity, float padding) Gets the corners of a rectangle hitbox of an entity adding padding around the box.
-
Field Details
-
PADDING
public static final float PADDING- See Also:
-
-
Method Details
-
adjustPos
public static com.badlogic.gdx.math.Vector2 adjustPos(com.badlogic.gdx.math.Vector2 pos, Entity entity) Takes a position relative to the center of an entity and converts it to a position relative to the bottom-left corner of the entity.- Parameters:
pos
- Position relative to center of entityentity
- The entity- Returns:
- Position relative to bottom-left of entity
-
getHitBoxCorners
Gets the corners of a rectangle hitbox of an entity adding padding around the box.- Parameters:
entity
- the entitypadding
- the padding to add around the hitbox- Returns:
- an array of vertices representing the corners of the hitbox
-
canBeeLineTo
Checks whether an entity can beeline to a position considering hitbox collisions and obstacles.- Parameters:
pos
- the target destinationentity
- the entity- Returns:
- whether the entity can beeline to the target position without hitting and obstacle.
-