An open-source and modular JavaScript game project featuring intelligent pathfinding and a modern UI. This repository is intended for developers and learners interested in game architecture, AI, and browser-based game development.
-
Simply try out the game at:
https://bunny.paradoxsolver.com/. -
Read
docs/README.mdanddocs/tutorial.htmlfor how to play, or refer to the online tutorial within the game. -
Download the executable version at:
https://paradoxsolver.itch.io/bunny-runaway.
- AI Pathfinding: A* algorithm for smart bunny movement
- Responsive Design: Works across devices and browsers
- Modular Codebase: Clean, maintainable, and extensible structure
- Modern UI: Attractive interface and smooth user experience
- Any modern web browser (Chrome, Firefox, Edge, Safari, etc.)
- Interpreter, one of the following two:
- Python 3.x (recommended for running a simple local server with
python -m http.server) - Node.js (optional, only if you want to use npm-based static servers or install dependencies)
- Python 3.x (recommended for running a simple local server with
- No build tools or package managers are required for basic development and running the game
- No JavaScript framework knowledge is needed; the project uses plain JavaScript (ES6+)
- If you want to modify or extend the code, a basic understanding of JavaScript modules and browser developer tools is helpful
You can run the game locally using any static file server. For example:
# Start a development server (Node.js required)
python -m http.server 8000
# or
npm install -g serve
serve .
# Then open
# http://localhost:8000/index.htmlBunnyRunAway/
โโโ src/ # Source code
โ โโโ app.js # Application entry point
โ โโโ core/ # Core game systems
โ โ โโโ GameController.js # Game controller
โ โ โโโ GameEngine.js # Game engine
โ โ โโโ GameLoop.js # Game loop
โ โ โโโ UIManager.js # UI manager
โ โ โโโ EventHandler.js # Event handler
โ โ โโโ ...
โ โโโ managers/ # Managers
โ โ โโโ GameInitializer.js # Game initializer
โ โ โโโ ConfigManager.js # Configuration manager
โ โ โโโ AudioManager.js # Audio manager
โ โ โโโ DialogManager.js # Dialog manager
โ โ โโโ ...
โ โโโ services/ # Game services
โ โ โโโ Bunny.js # Bunny AI
โ โ โโโ MapService.js # Map service
โ โ โโโ BlockerService.js # Blocker service
โ โ โโโ DocumentationService.js # Documentation service
โ โ โโโ ...
โ โโโ utils/ # Utilities
โ โโโ CanvasRenderer.js # Canvas renderer
โ โโโ CanvasCoordinateHelper.js # Coordinate helper
โ โโโ responsive-helper.js # Responsive helper
โ โโโ ...
โโโ css/ # Stylesheets
โ โโโ main.css # Main styles
โ โโโ components.css # ็ปไปถๆ ทๅผ
โ โโโ dialogs.css # ๅฏน่ฏๆกๆ ทๅผ
โ โโโ responsive.css # ๅๅบๅผๆ ทๅผ
โโโ assets/ # ้ๆ่ตๆบ
โ โโโ maps/ # ๅฐๅพๆฐๆฎ
โ โ โโโ easy/ # ็ฎๅ้พๅบฆๅฐๅพ
โ โ โโโ hard/ # ๅฐ้พ้พๅบฆๅฐๅพ
โ โโโ backgrounds/ # ่ๆฏๅพ็
โ โโโ sprites/ # ็ฒพ็ตๅพ็
โ โโโ tiles/ # ็ฆ็ๅพ็
โ โโโ sound/ # ้ณ้ขๆไปถ
โ โโโ fonts/ # ๅญไฝๆไปถ
โโโ config.json # ๆธธๆๅๆฐ้
็ฝฎ
โโโ docs/ # ๆๆกฃ
โ โโโ README.md # ้กน็ฎๆๆกฃ
โ โโโ tutorial.html # ๆ็จ้กต้ข
โ โโโ components.css # Component styles
โ โโโ dialogs.css # Dialog styles
โ โโโ responsive.css # Responsive styles
โโโ assets/ # Static assets
โ โโโ maps/ # Map data (easy/hard)
โ โโโ backgrounds/ # Background images
โ โโโ sprites/ # Sprites
โ โโโ tiles/ # Tiles
โ โโโ sound/ # Audio files
โ โโโ fonts/ # Fonts
โโโ config.json # Game configuration
โโโ docs/ # Documentation (see below)
โ โโโ README.md # Detailed docs
โ โโโ tutorial.html # Tutorial
โ โโโ credits.html # Credits
โโโ index.html # Main entry point
โโโ package.json # Project config
โโโ ReadMe.md # This file
- Intelligent Bunny AI: A* pathfinding
- Strategic Play: Place blockers to prevent the bunny from escaping
- Multiple Levels: 30 easy + 30 hard maps
- Real-time Feedback: Dynamic path visualization
- Pure JavaScript: No external dependencies required
- Modular Architecture: Easy to maintain and extend
- Responsive Design: Adapts to all screen sizes
- Modern UI: Smooth animations and user-friendly interface
- GameController: Main game controller, coordinates systems
- GameEngine: Game logic engine
- UIManager: UI management
- EventHandler: Global event management
- GameInitializer: Game initialization
- ConfigManager: Centralized configuration
- AudioManager: Music and sound
- DialogManager: Dialogs and popups
- Bunny: AI and pathfinding
- MapService: Map data and logic
- BlockerService: Blocker management
- DocumentationService: Documentation loading
- JavaScript ES6+ - Modern JavaScript
- Canvas API - 2D rendering
- ES6 Modules - Modular development
- CSS3 - Modern styles and animation
- A* Algorithm - Pathfinding
- Graph Theory - Map and blocker logic
- State Machine - Game state management
- Game Canvas: 900x600px play area
- Info Panel: Game state and controls
- Map Controls: Difficulty and map selection
- Game Controls: Start, pause, stop
- Tutorial Dialog: Gameplay instructions
- About Dialog: Game info
- Credits Dialog: Developer info
- License Dialog: Terms of use
- Game does not start: Check browser console for JavaScript errors; verify resource paths and module imports.
- Audio does not play: Most browsers require user interaction before playing audio. Click the game area first.
- Map loading fails: Ensure
assets/maps/exists and JSON files are valid.
In the browser console:
tutorialCommands.status() // Check tutorial status
tutorialCommands.restart() // Restart tutorial
tutorialCommands.help() // Show help- Use ES6+ syntax
- Modular development
- Clear comments and documentation
- Consistent naming conventions
- Group by feature/folder
- Keep structure clear
- Avoid circular dependencies
GPL3 - see LICENSE
Some images are generated using AI technology. Some code is written with the assistance of AI programming tools.
For open source and media attributions, see docs/credits.html.
Contributions are welcome! Please open issues or pull requests.
For more details, see the docs/ folder, including docs/README.md and docs/tutorial.html.
๐ Enjoy the game!