A fully functional Pokémon FireRed-style game built with React JS, featuring turn-based battles, world exploration, and clean architecture designed for scalability.
- ✅ Tile-based Pokémon-style map system
- ✅ Smooth player movement (WASD or Arrow keys)
- ✅ Camera follows player
- ✅ Collision detection with objects and NPCs
- ✅ Enter buildings (houses, PokéCenter)
- ✅ Multiple interconnected maps
- ✅ Talk to NPCs
- ✅ Dialog system with typewriter effect
- ✅ Read signs and interact with objects
- ✅ Trigger events and story moments
- ✅ Turn-based Pokémon battles
- ✅ Attack with different moves
- ✅ Switch Pokémon mid-battle
- ✅ Run from wild encounters
- ✅ Trainer battles (can't run)
- ✅ HP bars with color indicators
- ✅ Type-based move system
- ✅ Battle animations
- ✅ Party screen (view all Pokémon)
- ✅ Detailed stats display
- ✅ Type badges with colors
- ✅ HP and status indicators
- ✅ Switch Pokémon order
- ✅ Support for up to 6 Pokémon
- ✅ Heal all party Pokémon
- ✅ Nurse Joy interaction
- ✅ Healing animation
- ✅ Full HP restoration
- ✅ Clean, modern UI inspired by Pokémon FireRed
- ✅ Heads-up display (HUD)
- ✅ Quick party view
- ✅ Smooth animations and transitions
- ✅ Keyboard controls with hints
- ✅ Responsive design
- ✅ Visual map editor with drag-and-drop
- ✅ 9 brush types (grass, trees, buildings, portals, etc.)
- ✅ Auto-populate maps with nature
- ✅ Layer toggles and zoom controls
- ✅ Export maps as JSON
- ✅ Real-time statistics display
- ✅ Portal visualization
- ✅ Animated tile previews
- ✅ Fast travel between discovered locations
- ✅ Auto-discovery when walking over portals
- ✅ Beautiful portal menu UI
- ✅ Teleportation animations
- ✅ Persistent portal state
- ✅ Multiple portal types (standard, one-way, locked, hidden)
| Key | Action |
|---|---|
W A S D or Arrow Keys |
Move player |
Enter or Space |
Interact / Confirm |
E or Enter (on portal) |
Use portal |
P |
Open global portal menu |
M |
Open party menu |
Esc |
Cancel / Close |
| Action | How To |
|---|---|
| Select Brush | Click on brush icons in toolbar |
| Paint Tiles | Click and drag on canvas |
| Toggle Layers | Check/uncheck layer boxes |
| Zoom | Use +/− buttons |
| Auto-Populate | Click "🌳 Populate with Nature" |
| Export Map | Click "💾 Export Map" |
- Node.js 16+ installed
- npm or yarn package manager
# Clone the repository
git clone <your-repo-url>
# Navigate to project directory
cd pokemon-web
# Install dependencies
npm install
# Start development server
npm run devThe game will be available at http://localhost:5173
- Click "🎮 Play Game" to play the game
- Click "🎨 Map Designer" to create/edit maps visually
# Create production build
npm run build
# Preview production build
npm run previewpokemon-web/
├── src/
│ ├── components/ # React components
│ │ ├── Battle/ # Battle system
│ │ ├── Dialog/ # Dialog boxes
│ │ ├── Map/ # Map and world
│ │ ├── MapDesigner/ # 🆕 Visual map editor
│ │ ├── Menu/ # Game menus
│ │ ├── PokeCenter/ # Healing station
│ │ ├── Portal/ # 🆕 Portal system
│ │ └── UI/ # HUD and UI
│ ├── contexts/ # React Context (state management)
│ ├── data/ # JSON data files
│ │ ├── pokemon/ # Pokémon data
│ │ ├── moves/ # Move data
│ │ ├── trainers/ # Trainer/NPC data
│ │ ├── maps/ # Map layouts
│ │ └── items/ # Item data
│ ├── hooks/ # Custom React hooks
│ ├── pages/ # Main game page
│ ├── services/ # API service layer
│ │ ├── api.js # Fake API
│ │ ├── battleService.js # Battle engine
│ │ ├── encounterService.js # Wild encounters
│ │ └── portalService.js # 🆕 Portal management
│ └── utils/ # Utility functions
├── ARCHITECTURE.md # Detailed architecture docs
├── IMPROVEMENTS_GUIDE.md # Extensions documentation
├── PORTAL_SYSTEM.md # 🆕 Portal system guide
├── MAP_DESIGNER_GUIDE.md # 🆕 Map designer guide
└── README.md # This file
- Component Separation: Each component has a single responsibility
- Service Layer: Fake API that can be easily swapped with real endpoints
- State Management: Context API + useReducer for predictable state
- Custom Hooks: Game logic separated from UI components
User Input → Hooks → Actions → State Update → Component Re-render
↓
API Service
The game uses a fake API service that loads local JSON files asynchronously:
// Current implementation
const result = await pokemonAPI.getAll();
// Loads from: src/data/pokemon/pokemon.json
// Future: Just change the service, not the components!
const result = await fetch('/api/pokemon').then(r => r.json());All components are already prepared for real API integration! They handle:
- ✅ Loading states
- ✅ Error handling
- ✅ Async data
See ARCHITECTURE.md for complete documentation.
-
You start in Pallet Town with 3 starter Pokémon:
- Charmander (Fire type)
- Squirtle (Water type)
- Bulbasaur (Grass/Poison type)
-
Use WASD or Arrow Keys to move around
-
Press Enter/Space to interact with NPCs and objects
- Walk through grass to trigger random wild Pokémon encounters
- Encounter rate: ~15% per step in grass
- You can Run from wild battles
- Trainers will challenge you when you enter their line of sight
- You cannot run from trainer battles
- Defeat trainers to mark them as defeated
- Enter the PokéCenter (red building)
- Talk to Nurse Joy
- Accept healing to restore all Pokémon to full HP
- Press M to open the party menu
- View detailed stats for each Pokémon
- Switch Pokémon order by clicking
- Charmander (Fire)
- Squirtle (Water)
- Bulbasaur (Grass/Poison)
- Pikachu (Electric)
- Rattata (Normal)
- Scratch (Normal)
- Tackle (Normal)
- Water Gun (Water)
- Bite (Dark)
- Vine Whip (Grass)
- Pallet Town
- Route 1
- Viridian City
- PokéCenter (interior)
- Player House (interior)
- Bug Catcher Joey (Trainer)
- Nurse Joy (Healer)
- Professor Oak (Story NPC)
- Youngster Ben (Trainer)
- Shop Keeper (Merchant)
- Potion (Heal 20 HP)
- Super Potion (Heal 50 HP)
- Poké Ball (Catch Pokémon)
- Antidote (Cure poison)
- Escape Rope (Escape dungeons)
- Add entry to
src/data/pokemon/pokemon.json:
{
"id": 6,
"name": "Charizard",
"type": ["fire", "flying"],
"baseStats": {
"hp": 78,
"attack": 84,
"defense": 78,
"speed": 100
},
"moves": [1, 2],
"sprite": "charizard.png",
"level": 36
}- The API service will automatically load it!
Option 1: Use the Map Designer (Recommended)
- Click "🎨 Map Designer" button
- Click "🌳 Populate with Nature" for instant terrain
- Use brush tools to customize
- Click "💾 Export Map" to download JSON
- Add JSON to
src/data/maps/maps.json
Option 2: Manual JSON Editing
Edit src/data/maps/maps.json to add new map layouts with tiles, collisions, and encounters.
See MAP_DESIGNER_GUIDE.md for complete instructions.
Edit src/data/moves/moves.json to add new moves with type, power, and accuracy.
- Inventory system (use items in battle)
- Experience and leveling system
- Pokémon evolution
- Type effectiveness chart
- Status conditions (poison, burn, etc.)
- Save/Load game (LocalStorage)
- Sound effects and music
- More maps and Pokémon
- Catching wild Pokémon
- Trading system
- REST API backend (Node.js + Express)
- PostgreSQL database
- User authentication
- Online battles
- Cloud save system
- React 18.3.1 - UI framework
- Vite 5.4.2 - Build tool
- Context API - State management
- CSS3 - Styling and animations
- Press Start 2P - Retro game font
- ✅ Functional components with hooks
- ✅ Clean separation of concerns
- ✅ Commented code explaining decisions
- ✅ Reusable components and hooks
- ✅ Type-safe props (via JSDoc comments)
- ✅ No hardcoded data in components
- ✅ Optimized re-renders
- ✅ CSS animations (GPU accelerated)
- ✅ Event throttling for movement
- ✅ Lazy loading of data
- ✅ Small bundle size (~172KB)
- ARCHITECTURE.md - Complete architecture documentation
- IMPROVEMENTS_GUIDE.md - Wild encounters, battle AI, map transitions
- PORTAL_SYSTEM.md - Portal/fast travel system guide
- MAP_DESIGNER_GUIDE.md - Visual map editor documentation
- MAP_DESIGNER_SUMMARY.md - Map designer implementation details
- Code comments throughout the project
- JSDoc documentation for complex functions
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License.
- Inspired by Pokémon FireRed by Game Freak
- Built with React by Facebook/Meta
- Font: Press Start 2P by CodeMan38
For questions or feedback, please open an issue on GitHub.
Built with ❤️ and React by a senior game engineer and front-end architect
This is a fan project and is not affiliated with Nintendo, Game Freak, or The Pokémon Company.