Package com.mygdx.game.Components
Class ObstacleControl
- java.lang.Object
-
- com.mygdx.game.Components.Component
-
- com.mygdx.game.Components.ObstacleControl
-
public class ObstacleControl extends Component
// Added for Assessment 2 Requirements // Makes an Entity act as an Obstacle to the Player, causing damage upon collision in a variety of differing ways.
-
-
Field Summary
-
Fields inherited from class com.mygdx.game.Components.Component
parent, reqsMet, requirements, type
-
-
Constructor Summary
Constructors Constructor Description ObstacleControl(float damage, float hitRate, int hitLimit)
Generate an obstacle controller component.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
TryHit(CollisionInfo collision, boolean enter)
Attempts to perform a collision action
-
-
-
Constructor Detail
-
ObstacleControl
public ObstacleControl(float damage, float hitRate, int hitLimit)
Generate an obstacle controller component.- Parameters:
damage
- The damage that the obstacle does per 'hit'hitRate
- The rate at which 'hits' occur while collidinghitLimit
- The number of 'hits' required to break the obstacle
-
-
Method Detail
-
TryHit
public void TryHit(CollisionInfo collision, boolean enter)
Attempts to perform a collision action- Parameters:
collision
- the collision info to be attemptedenter
- boolean that determines whether the collision is allowed
-
-