Class ShipEntity
java.lang.Object
model.Entity
model.ShipEntity
- All Implemented Interfaces:
EventListener,EntityEventListener
The entity that represents the players ship
-
Field Summary
Fields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid*********************************************************************Methods inherited from class model.Entity
addEntityEventListener, collidesWith, collisionArea, draw, 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, toString, updateStateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface model.events.EntityEventListener
entityDied, entityMoved
-
Constructor Details
-
ShipEntity
public ShipEntity(int x, int y) Create a new entity to represent the players ship- Parameters:
x- The initial x location of the player's shipy- The initial y location of the player's shipgame- The game in which the ship is being createdref- The reference to the sprite to show for the ship
-
-
Method Details
-
collisionHasOccured
*********************************************************************- Specified by:
collisionHasOccuredin interfaceEntityEventListener- Overrides:
collisionHasOccuredin classEntity- Parameters:
e-
-