Class BorderEntity
java.lang.Object
model.Entity
model.BorderEntity
- All Implemented Interfaces:
EventListener,EntityEventListener
Entity of the game which is a Border. Borders will have IDs so that we can query which border we are working with.
Extends Entity class with width, height and border id
-
Field Summary
FieldsFields inherited from class model.Entity
canMoveDown, canMoveLeft, canMoveRight, canMoveUp, currentState, DEF_REF_TO_SPRITE_IMAGE_FILE, DEF_X, DEF_Y, DEFAULT_DEATH_RATE, dx, dy, dyingSpritesList, justEnteredState, LIFE_LEFT_TOLERANCE, lifeLeft, sound, sprite, x, y -
Constructor Summary
ConstructorsConstructorDescription************************* constructors *********************************BorderEntity(int initialXPos, int initialYPos, int width, int height) BorderEntity(String id) BorderEntity(String id, int width, int height) BorderEntity(String id, int initialXPos, int initialYPos, int width, int height) -
Method Summary
Methods inherited from class model.Entity
addEntityEventListener, collidesWith, collisionHasOccured, entityDied, entityMoved, equals, fireCollisionHasOccured, fireEntityDied, fireEntityMoved, getCurrentState, getDyingSpritesList, getHorizontalMovement, getLifeLeft, getSound, getSprite, getVerticalMovement, getX, getY, hashCode, move, moveTo, removeEntityEventListener, setCurrentState, setDyingSpritesList, setHorizontalMovement, setLifeLeft, setSound, setSprite, setVerticalMovement, updateState
-
Field Details
-
DEFAULT_WIDTH
public static final int DEFAULT_WIDTH- See Also:
-
DEFAULT_HEIGHT
public static final int DEFAULT_HEIGHT- See Also:
-
DEFAULT_ID
- See Also:
-
-
Constructor Details
-
BorderEntity
public BorderEntity()************************* constructors ********************************* -
BorderEntity
-
BorderEntity
-
BorderEntity
public BorderEntity(int initialXPos, int initialYPos, int width, int height) -
BorderEntity
-
-
Method Details
-
setWidth
public void setWidth(int width) -
setHeight
public void setHeight(int height) -
setId
-
getWidth
public int getWidth() -
getHeight
public int getHeight() -
getId
-
toString
-
collisionArea
Define the area of the Entity to use for collision detection. This default uses the location and size of sprite.- Overrides:
collisionAreain classEntity- Returns:
- the Rectangle this border covers
-
draw
-