Class StickyForce

java.lang.Object
de.gurkenlabs.litiengine.physics.Force
de.gurkenlabs.litiengine.physics.StickyForce

public class StickyForce extends Force
The Force implementation sticks to an entity in terms of its location.
  • Constructor Details

    • StickyForce

      public StickyForce(IEntity forceEntity, float strength, float size)
      Instantiates a new sticky force.
      Parameters:
      forceEntity - The entity to who's location this force will be bound
      strength - The strength/intensity of this force
      size - The size of this force
    • StickyForce

      public StickyForce(Point2D center, float strength, float size)
  • Method Details

    • getForceEntity

      public IEntity getForceEntity()
      Gets the force entity.
      Returns:
      the force entity
    • getLocation

      public Point2D getLocation()
      Description copied from class: Force
      Gets the location.
      Overrides:
      getLocation in class Force
      Returns:
      the location
    • cancelOnReached

      public boolean cancelOnReached()
      Overrides:
      cancelOnReached in class Force