Package model.entities
Class SkelMonstaModel
java.lang.Object
model.entities.EntityModel
model.entities.EnemyModel
model.entities.SkelMonstaModel
SkelMonstaModel class is responsible for the skel monsta enemy logic
-
Field Summary
Fields inherited from class model.entities.EnemyModel
active, alive, enemyState, enemyType, fallSpeed, flySpeed, goDown, goUp, isFalling, isJumping, playerTileX, playerTileY, previousWalkingDir, reachedSpawn, spawnY, startWalkingDir, updatePlayerPosMaxInterval, walkingDir, walkSpeed, xSpeed, ySpeedFields inherited from class model.entities.EntityModel
height, hitbox, immune, levelManagerModel, timer, width, x, y -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new SkelMonstaModel with default spawn position and state. -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()Activates the SkelMonsta, setting it to active state.voidActivates the despawning state for the SkelMonsta.voidDeactivates the SkelMonsta, setting it to inactive state.Gets the type of the enemy.booleanChecks if the SkelMonsta is in the despawning state.booleanisMoving()Checks if the SkelMonsta is moving.booleanChecks if the SkelMonsta is in the spawning state.voidreset()Resets the SkelMonsta to its initial state.voidupdate(PlayerModel playerModel) Updates the state and behavior of the SkelMonsta enemy.Methods inherited from class model.entities.EnemyModel
bubbleCapture, calculatePlayersPos, canFall, changeWalkingDir, flipW, flipX, getEnemyState, getReachedSpawn, instantKill, isActive, isAlive, isPlayerInViewingRange, isPlayerLeftOrRight, isPlayerUpOrDown, resetEnemy, setActive, setAlive, setEnemyState, updateSpawning, updateStateVariables, updateWalkingDirMethods inherited from class model.entities.EntityModel
conpenetrationSafeUpdateXPos, getHitbox, getTileX, getTileY, initHitbox, initLevelManager, isImmune, updateXPos
-
Constructor Details
-
SkelMonstaModel
public SkelMonstaModel()Constructs a new SkelMonstaModel with default spawn position and state.
-
-
Method Details
-
update
Updates the state and behavior of the SkelMonsta enemy.- Specified by:
updatein classEnemyModel- Parameters:
playerModel- the player model to interact with
-
reset
public void reset()Resets the SkelMonsta to its initial state. -
activate
public void activate()Activates the SkelMonsta, setting it to active state. -
deactivate
public void deactivate()Deactivates the SkelMonsta, setting it to inactive state.- Overrides:
deactivatein classEntityModel
-
activateDespawn
public void activateDespawn()Activates the despawning state for the SkelMonsta. -
getEnemyType
Gets the type of the enemy.- Specified by:
getEnemyTypein classEnemyModel- Returns:
- the enemy type
-
isDespawning
public boolean isDespawning()Checks if the SkelMonsta is in the despawning state.- Returns:
- true if despawning, false otherwise
-
isSpawning
public boolean isSpawning()Checks if the SkelMonsta is in the spawning state.- Returns:
- true if spawning, false otherwise
-
isMoving
public boolean isMoving()Checks if the SkelMonsta is moving.- Returns:
- true if moving, false otherwise
-