Class Ghost
java.lang.Object
fr.paris.saclay.sidescroller.drawables.Drawable
fr.paris.saclay.sidescroller.drawables.entities.Entity
fr.paris.saclay.sidescroller.drawables.entities.enemies.Ghost
Ghost enemy.
-
Field Summary
Fields inherited from class fr.paris.saclay.sidescroller.drawables.entities.Entity
animationMap, attackHitBox, attackHitboxSize, blockHitBox, blockHitboxSize, hitBox, hitboxSize, image, invincibilityTimer, isAttacking, isBlocking, isDead, isInvincible, isJumping, lifePoints, maximumInvincibility, maximumLifePoints, spriteCounter, spriteNumber -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidGhosts have a slight vertical movement so that it looks like they are "floating".protected voidActivates "invisible" sprite every other 60 frames.Methods inherited from class fr.paris.saclay.sidescroller.drawables.entities.Entity
chasePlayer, draw, drawHpBar, getAttackHitBox, getBlockHitBox, getHitBox, getLifePoints, getMaximumInvincibility, getMaximumLifePoints, isAttacking, isBlocking, isDead, isInvincible, isJumping, setAttacking, setAttackSprites, setBlockSprites, setDead, setEntityInvincible, setJumpSprites, setSprites, tookDamage, update, updateHitboxPositionMethods inherited from class fr.paris.saclay.sidescroller.drawables.Drawable
getXPosition, updatePositionToCamera
-
Constructor Details
-
Ghost
Creates a Ghost instance passing the GamePanel reference and initial position of the entity.- Parameters:
gamePanel- reference.xPosition- initial position.
-
-
Method Details
-
uniqueMovement
protected void uniqueMovement()Ghosts have a slight vertical movement so that it looks like they are "floating".- Overrides:
uniqueMovementin classEntity
-
updateSprites
protected void updateSprites()Activates "invisible" sprite every other 60 frames.
NOTE: this is just a visual feature, hitbox and damage are still active.- Overrides:
updateSpritesin classEntity
-