Class ShotEntity
java.lang.Object
model.Entity
model.AnimatedEntity
model.ShotEntity
- All Implemented Interfaces:
EventListener,EntityEventListener
- Direct Known Subclasses:
AlienShotEntity
An entity representing a shot fired by the player's ship
-
Field Summary
Fields inherited from class model.AnimatedEntity
animated, ANIMATION_SPEED, animationSpritesList, currentMoveSprite, currentSprite, millisLastRotatedFields 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
ConstructorsConstructorDescriptionShotEntity(int x, int y) Create a new shot from the playerShotEntity(int x, int y, double yMoveSpeed) Create a new shot from the player -
Method Summary
Modifier and TypeMethodDescriptionvoidNo Action by defaultMethods inherited from class model.AnimatedEntity
getAnimationSpritesList, setAnimated, setAnimationSpritesList, updateStateMethods 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
-
Constructor Details
-
ShotEntity
public ShotEntity(int x, int y) Create a new shot from the player- Parameters:
x- The initial x location of the shoty- The initial y location of the shotgame- The game in which the shot has been createdsprite- The sprite representing this shot
-
ShotEntity
public ShotEntity(int x, int y, double yMoveSpeed) Create a new shot from the player- Parameters:
x- The initial x location of the shoty- The initial y location of the shotgame- The game in which the shot has been createdsprite- The sprite representing this shot
-
-
Method Details
-
collisionHasOccured
Description copied from class:EntityNo Action by default- Specified by:
collisionHasOccuredin interfaceEntityEventListener- Overrides:
collisionHasOccuredin classEntity- Parameters:
e-
-