A top-view 2D game set in the woods where one player controls a fox hiding from computer-controlled hunters, and another player controls a dragon that protects the fox by shooting fireballs at the hunters. Built with PixiJS and TypeScript.
You can play the game online at: https://josecoelho.github.io/fox-escape
Note: The game will be available at this URL once deployment is complete.
- Player 1 (Fox): Collect food while avoiding being seen by hunters. The fox can hide temporarily to avoid detection.
- Player 2 (Dragon): Protect the fox by shooting fireballs at hunters.
- Hunters: Computer-controlled characters that patrol the map and chase the fox if spotted.
- Food & Poo: When the fox eats food, it creates poo. Hunters that step in poo get stuck for 5 seconds.
- Score: Earn points by collecting food, defeating hunters, and getting hunters stuck in poo.
- Fox (Player 1):
- Arrow keys to move
- Space to hide (10-second cooldown, lasts 2 seconds)
- Dragon (Player 2):
- WASD keys to move
- F to shoot fireballs
- Fox (Left Side):
- Left joystick to move
- HIDE button to activate hiding ability
- Dragon (Right Side):
- Right joystick to move
- FIRE button to shoot fireballs
- Node.js (version 14 or higher)
- npm or yarn
# Clone the repository
git clone https://github.com/yourusername/fox-escape.git
cd fox-escape
# Install dependencies
npm installnpm run devThis will start a Vite dev server on http://localhost:3000.
npm run buildThe build files will be located in the dist directory.
npm run preview# Run all tests
npm test
# Run tests in watch mode
npm run test:watchsrc/- Source codecore/- Core game engineentities/- Game entities (Fox, Dragon, Hunter, etc.)systems/- Game systems (Collision, etc.)utils/- Utility classes and functionsconfig/- Game configuration
public/- Static assets and HTMLdist/- Build output
To add a new map, create a new configuration in src/config/MapConfig.ts following the existing examples. Maps define:
- Dimensions
- Food count
- Hunter count
- Background texture
- Obstacle textures and positions
This project is licensed under the MIT License - see the LICENSE file for details.