Class MaitaFireProjectileModel


public class MaitaFireProjectileModel extends ProjectileModel
Represents the logic of a Maita fire projectile in the game.
  • Constructor Details

    • MaitaFireProjectileModel

      public MaitaFireProjectileModel(float x, float y, Constants.Direction direction)
      Constructs a MaitaFireProjectileModel with the specified position and direction.
      Parameters:
      x - the x-coordinate of the projectile
      y - the y-coordinate of the projectile
      direction - the direction of the projectile
  • Method Details

    • updatePos

      protected void updatePos()
      Updates the position of the projectile.

      Moves the projectile left or right based on its direction and changes its state to IMPACT if collide with an obstacle.

      Specified by:
      updatePos in class ProjectileModel
    • checkEnemyHit

      public void checkEnemyHit(EnemyModel enemyModel, PlayerModel playerModel)
      Checks if the projectile hits an enemy.

      This method is not used as Maita fire projectiles cannot hit enemies.

      Specified by:
      checkEnemyHit in class ProjectileModel
      Parameters:
      enemyModel - the enemy model to check against
      playerModel - the player model to check against
    • checkPlayerHit

      public void checkPlayerHit(PlayerModel playerModel)
      Checks if the projectile hits the player.

      If the projectile hits an active and non-immune player, it kills the player and changes its state to IMPACT.

      Specified by:
      checkPlayerHit in class ProjectileModel
      Parameters:
      playerModel - the player model to check against