Class StickyForce
java.lang.Object
de.gurkenlabs.litiengine.physics.Force
de.gurkenlabs.litiengine.physics.StickyForce
The Force implementation sticks to an entity in terms of its location.
-
Constructor Summary
ConstructorsConstructorDescriptionStickyForce(IEntity forceEntity, float strength, float size) Instantiates a new sticky force.StickyForce(Point2D center, float strength, float size) Instantiates a new sticky force. -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if the force should be canceled when the target is reached.Gets the force entity.Gets the location.Methods inherited from class de.gurkenlabs.litiengine.physics.Force
cancelOnCollision, end, getIdentifier, getStrength, hasEnded, hasReached, setCancelOnCollision, setCancelOnReached, setIdentifier, setLocation, setStrength, toString
-
Constructor Details
-
StickyForce
Instantiates a new sticky force.- Parameters:
forceEntity- The entity to which this force will be boundstrength- The strength/intensity of this forcesize- The size of this force
-
StickyForce
Instantiates a new sticky force.- Parameters:
center- The center point to which this force will be boundstrength- The strength/intensity of this forcesize- The size of this force
-
-
Method Details
-
getForceEntity
-
getLocation
Description copied from class:ForceGets the location.- Overrides:
getLocationin classForce- Returns:
- the location
-
cancelOnReached
public boolean cancelOnReached()Description copied from class:ForceChecks if the force should be canceled when the target is reached.- Overrides:
cancelOnReachedin classForce- Returns:
- true if the force should be canceled when the target is reached, false otherwise
-