Class: ChickenSmall

ChickenSmall()

Represents a small chicken enemy in the game, extending the MovableObject class. The chicken can walk, jump, and die, and is subject to gravity.

Constructor

new ChickenSmall()

Constructs a new ChickenSmall, loads images, initializes position, sets its speed, applies gravity, and starts animation.
Source:

Members

IMAGES_DEAD :Array.<string>

An array of image paths for the chicken's death animation.
Type:
  • Array.<string>
Source:

IMAGES_WALKING :Array.<string>

An array of image paths for the chicken's walking animation.
Type:
  • Array.<string>
Source:

Methods

animate()

Manages the chicken's movement and animation intervals. The chicken will walk, play walking animation, jump if on the ground, and switch to the death animation when it dies.
Source:

moveEnemie()

Sets an interval for the chicken to move left, as long as it is not dead.
Source:

resetEnemy()

Resets the chicken to a new position, restores energy, revives it, and assigns a random speed within the specified range.
Source: