A thrilling 3D zombie survival game built with React, Three.js, and React Three Fiber. Navigate through a post-apocalyptic city environment while avoiding zombie hordes in this immersive web-based game.
- Immersive 3D Environment: Explore a detailed city environment with buildings, cars, and atmospheric effects
- Realistic Physics: Powered by React Three Rapier for authentic movement and collisions
- Character Controls: Smooth character movement with walking, running, jumping, and combat animations
- Atmospheric Effects:
- Dynamic UFO with animated beam
- Floating particles
- Fog effects
- Ambient lighting
- Sound Design: Background music and positional audio for enhanced immersion
- Mobile Support: Touch controls with on-screen joystick for mobile devices
- Performance Options: Toggle shadows and FPS counter for optimal performance
- Pakistani Theme: Features Pakistani flags in the environment
- React (v19.1.0) - UI framework
- Three.js (v0.177.0) - 3D graphics library
- React Three Fiber - React renderer for Three.js
- React Three Drei - Useful helpers for React Three Fiber
- React Three Rapier - Physics engine integration
- TypeScript - Type safety and better developer experience
- Vite - Fast build tool and development server
- Tailwind CSS - Utility-first CSS framework
- Ecctrl - Character controller for Three.js
- Node.js (v14 or higher)
- npm or yarn
- Clone the repository:
git clone https://github.com/abdulrehmanwaseem/3d-Zombie-Invasion-Game.git
cd 3d-Zombie-Invasion-Game
- Install dependencies:
npm install
- Start the development server:
npm run dev
- Open your browser and navigate to
http://localhost:5173
npm run build
The build output will be in the dist
directory.
Action | Keys |
---|---|
Movement | |
Move Forward | W or โ |
Move Backward | S or โ |
Move Left | A or โ |
Move Right | D or โ |
Jump | Space |
Run/Sprint | Shift |
Combat | |
Melee Attack | F |
Kick Attack | E |
Other | |
Emote | 1 |
Pause Menu | Tab |
- Use the on-screen joystick for movement
- Touch buttons for actions
You can adjust the following settings in-game:
- Shadows: Toggle shadow rendering for better performance
- FPS Counter: Show/hide performance statistics
Access settings from the main menu or press Tab
during gameplay.
zombie-invasion-game/
โโโ public/
โ โโโ models/ # 3D models and textures
โ โ โโโ character.glb
โ โ โโโ invasion_environment.glb
โ โ โโโ pakistan_flag.glb
โ โ โโโ Textures/
โ โโโ images/ # UI images
โ โโโ sounds/ # Audio files
โโโ src/
โ โโโ components/ # React components
โ โ โโโ AtmosphericEffects.tsx
โ โ โโโ Character.tsx
โ โ โโโ ControlsModal.tsx
โ โ โโโ Experience.tsx
โ โ โโโ Invasion_environment.tsx
โ โ โโโ Pakistan_flag.tsx
โ โ โโโ SettingsModal.tsx
โ โ โโโ StartMenu.tsx
โ โ โโโ ZombieLoadingScreen.tsx
โ โโโ data/ # Configuration files
โ โ โโโ animationSet.json
โ โ โโโ keyboardMap.json
โ โโโ App.tsx
โ โโโ main.tsx
โ โโโ index.css
โโโ package.json
โโโ tsconfig.json
โโโ vite.config.ts
- Detailed city environment with multiple buildings
- Police station centerpiece
- Scattered vehicles and urban props
- Dynamic billboards with game branding
- UFO hovering above the city with animated beam
- Floating particle system
- Atmospheric fog
- Dynamic lighting including ambient, directional, and spot lights
- Animated character with multiple actions
- Smooth transitions between animations
- Physics-based movement
- Combat system with melee and kick attacks
npm run dev
- Start development servernpm run build
- Build for productionnpm run lint
- Run ESLintnpm run preview
- Preview production build
- New 3D Models: Place
.glb
files inpublic/models/
- New Animations: Update
src/data/animationSet.json
- New Controls: Modify
src/data/keyboardMap.json
- New Components: Add to
src/components/
- Performance may vary on lower-end devices
- Mobile controls might need adjustment based on screen size
- Some animations may not trigger correctly on rapid input
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Developer: Abdul Rehman
- 3D Models: Custom and community assets
- Sound Effects: Background ambience and effects
- Inspiration: Classic zombie survival games
Abdul Rehman - GitHub Profile
Project Link: https://github.com/abdulrehmanwaseem/3d-Zombie-Invasion-Game
Made with โค๏ธ by Abdul Rehman
ยฉ 2025 Zombie Invasion. All rights reserved.