A classic 2D jump-and-run game built with HTML5 Canvas and vanilla JavaScript. Help Pepe defeat the crazy chickens and their evil boss to save the day!
- About
- Features
- Demo
- Installation
- How to Play
- Project Structure
- Technologies
- Architecture
- Development
- Browser Support
- License
El Pollo Loco is a browser-based platformer game inspired by classic jump-and-run games. Players control Pepe, who must navigate through a desert landscape, collect items, defeat enemies, and ultimately face off against the endboss chicken.
- Smooth gameplay with 60 FPS game loop
- Responsive design that works on desktop and mobile devices
- Touch controls for mobile gameplay
- Audio system with background music and sound effects
- Fullscreen mode support
- Mute functionality with persistent state
- Game states: Landing page, gameplay, game over, and victory screens
- Collision detection for enemies, items, and projectiles
- Health, coin, and bottle collection systems
- Status bars for tracking player stats
- Endboss battle with unique mechanics
- Accessibility features including keyboard navigation and ARIA labels
- Orientation warning for mobile devices
Open index.html in your web browser to play the game.
- Clone or download this repository
- Open
index.htmlin a modern web browser - Start playing!
For the best experience, run the game on a local server:
# Using Python 3
python -m http.server 8000
# Using Node.js (http-server)
npx http-server
# Using PHP
php -S localhost:8000Then open http://localhost:8000 in your browser.
Help Pepe defeat the crazy chickens and their evil boss to save the day!
- Arrow Left (←): Move left
- Arrow Right (→): Move right
- Space: Jump
- D: Throw bottle
Touch buttons are displayed on mobile devices and smaller screens.
- Collect bottles to use as projectiles
- Collect coins for points
- Jump on chickens to defeat small enemies
- Throw bottles at the endboss to defeat it
- Avoid damage from enemies and the endboss
- Watch your health displayed in the status bar
elpollo/
├── assets/ # Font files
│ └── fonts/
├── audio/ # Sound effects and music
├── css/ # Stylesheets
│ └── main.css
├── debug/ # Debug and testing utilities
├── img/ # Game sprites and backgrounds
│ ├── 1_other/
│ ├── 2_character_pepe/
│ ├── 3_enemies_chicken/
│ ├── 4_enemie_boss_chicken/
│ ├── 5_background/
│ ├── 6_salsa_bottle/
│ ├── 7_statusbars/
│ ├── 8_coin/
│ └── 9_intro_outro_screens/
├── js/ # Main JavaScript files
│ ├── game.js # Game initialization
│ ├── game-ui-controls.js
│ ├── game-touch-controls.js
│ ├── interval-manager.js
│ ├── orientation-fullscreen.js
│ └── accessibility-helper.js
├── levels/ # Level configurations
│ └── level1.js
├── models/ # Game object classes
│ ├── character.class.js
│ ├── endboss.class.js
│ ├── world.class.js
│ ├── movable-object.class.js
│ ├── drawable-object.class.js
│ ├── audio-manager.class.js
│ └── ... (other game classes)
├── tools/ # Development tools
├── index.html # Main entry point
├── impressum.html # Imprint page
└── README.md # This file
- HTML5 Canvas - For rendering the game
- Vanilla JavaScript (ES6+) - Game logic and object-oriented programming
- CSS3 - Styling and animations
- Web Audio API - Sound management
- LocalStorage API - Persistent game settings
DrawableObject- Base class for all drawable game objectsMovableObject- Extends DrawableObject with movement and physicsCharacter- Player-controlled character with movement, jumping, and actionsEndboss- Final boss enemy with complex behaviorChicken- Standard enemyChickenSmall- Smaller, faster enemy variantThrowableObject- Projectile (bottle) mechanics
World- Main game world manager, coordinates all game systemsWorldCollision- Handles collision detection between game objectsWorldEndboss- Manages endboss-specific logicLevel- Level configuration and object managementCamera- Handles camera movement and viewportUIManager- Manages status bars and UI elementsAudioManager- Centralized audio systemGameStateManager- Manages game states and transitionsKeyboard- Keyboard input handlerDebugHelper- Debug visualization tools
StatusBar- Base class for all status barsStatusBarHealth- Player health displayStatusBarCoins- Coin collection displayStatusBarBottles- Bottle inventory displayStatusBarEndboss- Endboss health display
- Object-Oriented Programming with ES6 classes
- Inheritance for code reuse (DrawableObject → MovableObject → Character)
- Composition for game systems (World contains Camera, UIManager, etc.)
- Singleton-like patterns for global managers (AudioManager, GameStateManager)
- Observer pattern for game events and state changes
The game runs at 60 FPS using setInterval with collision detection, movement updates, and rendering synchronized.
- JSDoc documentation for all classes and functions
- Modular architecture with separated concerns
- Consistent code style following modern JavaScript conventions
- Accessibility features with ARIA labels and keyboard navigation
Debug mode can be enabled to visualize:
- Collision boxes
- Object boundaries
- Performance metrics
- Create new classes in the
models/directory - Extend
DrawableObjectorMovableObjectas needed - Add new instances to level configuration in
levels/level1.js - Document with JSDoc comments
- Chrome/Edge (latest)
- Firefox (latest)
- Safari (latest)
- Mobile browsers (iOS Safari, Chrome Mobile)
Requirements:
- HTML5 Canvas support
- ES6+ JavaScript support
- LocalStorage API
This project was created for educational purposes.
All game assets (images, audio) are used for educational and non-commercial purposes only.
Developed with ❤️ using HTML5 Canvas and Vanilla JavaScript