Package model.entities.enemies
Class DrunkModel
java.lang.Object
model.entities.EntityModel
model.entities.enemies.EnemyModel
model.entities.enemies.DrunkModel
- All Implemented Interfaces:
Fallable
La classe
DrunkModel rappresenta il nemico Drunk.
Estende la classe EnemyModel e gestisce il movimento e l'attacco.-
Field Summary
Fields inherited from class model.entities.enemies.EnemyModel
active, angry, bubbleSpeed, enemyState, foodSpawned, goingUp, inBubble, inBubbleTime, pathDuration, pathTick, resetAniTick, shootingTick, shootingTimer, shot, still, stillTick, stillTimer, stuck, targetYTile, walkDir, walkSpeedFields inherited from class model.entities.EntityModel
airSpeed, fallingSpeed, fallSpeedAfterCollision, gravity, height, hitbox, inAir, width, x, y -
Constructor Summary
ConstructorsConstructorDescriptionDrunkModel(float x, float y) Crea un nuovo modello di Drunk con le coordinate specificate. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidGestisce il lancio delle bottiglie.voidupdate()Aggiorna lo stato del nemico.Methods inherited from class model.entities.enemies.EnemyModel
checkBubbleDirection, checkThreeYTilesSolid, checkUpSolid, doDeathMovement, getEnemyState, getEnemyTileX, getEnemyTileY, getPlayerTileX, getPlayerTileY, getWalkDir, inBubbleMovement, isActive, isBubbleInXRange, isDeathMovement, isEnemyOnPlayerY, isFoodSpawned, isInBubble, isPlayerOnTopOfTheEnemy, isPlayerToLeftOfEnemy, isPlayerToRightOfEnemy, isResetAniTick, playerAndEnemyAreOnTheSameRow, setActive, setEnemyState, setFoodSpawned, setInBubble, setResetAniTick, startFloating, startShootingTimer, startStillTimer, updateEnemyState, updatePos, updateXPos, walkWithDifferentY, walkwithSameYMethods inherited from class model.entities.EntityModel
checkOutOfMap, fallingChecks, getHeight, getHitbox, getLevelManager, getWidth, getX, getY, initHitbox, isInAir, isInAirCheck, resetInAir, setFallingSpeed
-
Constructor Details
-
DrunkModel
public DrunkModel(float x, float y) Crea un nuovo modello di Drunk con le coordinate specificate. Crea un nuovo modello di Drunk con le coordinate specificate.- Parameters:
x- la coordinata X inizialey- la coordinata Y iniziale
-
-
Method Details
-
update
public void update()Aggiorna lo stato del nemico. Se il nemico è in corsa o in corsa arrabbiato, gestisce il movimento e l'attacco a seconda della sua condizione attuale.- Overrides:
updatein classEnemyModel
-
checKBottleShooting
private void checKBottleShooting()Gestisce il lancio delle bottiglie. Se è fermo e non ha già sparato, crea una nuova bottiglia e la lancia.
-