El Pollo Loco is a Jump & Run game developed with Vanilla JavaScript and HTML5 Canvas. The player controls Pepe, who fights against chickens and an end boss.
This project uses JSDoc for code documentation. All classes, methods, and important properties are documented.
- DrawableObject - Base class for all renderable objects
- MovableObject - Extends DrawableObject with physics and collision detection
- Character - The playable character (Pepe)
- World - Game engine and rendering pipeline
- Level - Level configuration with enemies and collectibles
- Chicken - Normal chickens
- ChickenSmall - Small chickens
- Endboss - Boss enemy with AI
- Coin - Coins to collect
- Bottle - Bottles (ammunition for throwing)
- StatusBar - Base class for all status bars
- HealthBar - Health display
- CoinBar - Coin counter
- BottleBar - Bottle counter
- EndbossBar - Endboss health display
To create the HTML documentation:
# Install JSDoc (if not already installed)
npm install -g jsdoc
# Optional: Install nice template
npm install docdash
# Generate documentation
jsdoc -c jsdoc.json
# Or simply:
jsdoc models js levels -d docs -rThe generated documentation can be found in the docs/ folder.
Open docs/index.html in your browser to view the generated documentation.
- ✅ All functions ≤14 lines
- ✅ All comments in English
- ✅ JSDoc for all classes and public methods
- ✅ Clean Code principles
- ✅ OOP with inheritance (3 levels)
DrawableObject (Rendering)
├─ MovableObject (Physik)
│ ├─ Character
│ ├─ Enemies (Chicken, ChickenSmall, Endboss)
│ ├─ Collectables (Coin, Bottle)
│ └─ ThrowableObject
└─ StatusBar (UI)
└─ HealthBar, CoinBar, BottleBar, EndbossBar
@class- Class declaration@extends- Inheritance@type- Property types@param- Function parameters@returns- Return values
/**
* Main playable character (Pepe).
* @extends MovableObject
*/
class Character extends MovableObject {
/** @type {number} */
height = 250;
/**
* Moves character to the right.
*/
moveRight() {
this.x += this.speed;
}
}