Skip to content

Latest commit

ย 

History

30 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

El Pollo Loco - JSDoc Documentation

๐ŸŽฎ About the Game

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.

๐Ÿ“š Code Documentation

This project uses JSDoc for code documentation. All classes, methods, and important properties are documented.

Main Classes

  • 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

Enemies

  • Chicken - Normal chickens
  • ChickenSmall - Small chickens
  • Endboss - Boss enemy with AI

Collectibles

  • Coin - Coins to collect
  • Bottle - Bottles (ammunition for throwing)

UI Components

  • StatusBar - Base class for all status bars
  • HealthBar - Health display
  • CoinBar - Coin counter
  • BottleBar - Bottle counter
  • EndbossBar - Endboss health display

๐Ÿ› ๏ธ Generate JSDoc HTML

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 -r

The generated documentation can be found in the docs/ folder.

๐Ÿ“– View Online

Open docs/index.html in your browser to view the generated documentation.

๐ŸŽฏ Code Quality

  • โœ… All functions โ‰ค14 lines
  • โœ… All comments in English
  • โœ… JSDoc for all classes and public methods
  • โœ… Clean Code principles
  • โœ… OOP with inheritance (3 levels)

๐Ÿ—๏ธ Architecture

DrawableObject (Rendering)
  โ”œโ”€ MovableObject (Physik)
  โ”‚   โ”œโ”€ Character
  โ”‚   โ”œโ”€ Enemies (Chicken, ChickenSmall, Endboss)
  โ”‚   โ”œโ”€ Collectables (Coin, Bottle)
  โ”‚   โ””โ”€ ThrowableObject
  โ””โ”€ StatusBar (UI)
      โ””โ”€ HealthBar, CoinBar, BottleBar, EndbossBar

๐Ÿ“ JSDoc Tags Used

  • @class - Class declaration
  • @extends - Inheritance
  • @type - Property types
  • @param - Function parameters
  • @returns - Return values

๐Ÿ’ก Example

/**
 * Main playable character (Pepe).
 * @extends MovableObject
 */
class Character extends MovableObject {
  /** @type {number} */
  height = 250;

  /**
   * Moves character to the right.
   */
  moveRight() {
    this.x += this.speed;
  }
}

About

๐Ÿ” 2D-Jump'n'Run-Browsergame mit objektorientiertem JavaScript und HTML-Canvas

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages