Class: Chicken

Chicken()

Represents a normal-sized chicken enemy in the game, extending the MovableObject class. The chicken can walk, die, and move left at a specified speed.

Constructor

new Chicken()

Constructs a new chicken, loads its images, sets its initial position, speed, and starts the 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()

Handles the chicken's movement and animation intervals for walking and death.
Source:

moveEnemie()

Moves the chicken to the left at a set interval, provided it is not dead.
Source:

resetEnemy()

Resets the chicken's position, energy, and speed, and revives it if dead.
Source: