Class EntityEntityCollision

  • public class EntityEntityCollision
    extends java.lang.Object
    A collision between two different entities
    • Field Detail

      • previouslyCollided

        private boolean previouslyCollided
        Prevents boundary colors from being set more than they have to
      • firedEvent

        private boolean firedEvent
        Whether or not the onCollide event has been fired
      • isCollided

        public boolean isCollided
        Whether or not the two entities are collided
      • isActive

        public boolean isActive
        Whether or not the collision is currently being used
      • isMovementRestricting

        public boolean isMovementRestricting
        Whether or not the collision would impose movement restrictions, typically on the player
      • rectangles

        private final java.awt.Rectangle[] rectangles
      • entities

        public Entity[] entities
        Entities that are to collide
    • Constructor Detail

      • EntityEntityCollision

        public EntityEntityCollision​(EntityBoundary boundary1,
                                     EntityBoundary boundary2)
        Creates a new collision between two entity boundaries
        boundary1 - First entity's boundary
        boundary2 - Second entity's boundary
    • Method Detail

      • start

        public void start​(EntityEntityCollisionEvent event)
        This is called once after the collision occurs
        event - The collision's event
      • end

        public void end​(EntityEntityCollisionEvent event)
        This is called once after the collision ends
        event - The collision's event
      • end

        public void end()
      • deactivate

        public void deactivate()
      • activate

        public void activate()
      • setBoundaryColors

        private void setBoundaryColors()
        Sets or updates the colors for both boundaries
      • determineBoundaryColors

        private void determineBoundaryColors​(java.util.ArrayList<EntityBoundary> e)
      • determineBoundaryColor

        private void determineBoundaryColor​(EntityBoundary e)
      • toString

        public java.lang.String toString()
        toString in class java.lang.Object