A modern, web-based third-person shooter game built with React Three Fiber, TypeScript, and Rapier Physics. Experience smooth gameplay with advanced camera controls, realistic physics, and immersive 3D graphics - all running in your browser!
- ๐ฏ Smooth Third-Person Camera System with intelligent collision detection
- ๐ Realistic Movement Controls - Walk, run, strafe, jump, and crouch
- ๐ซ Dynamic Shooting System with muzzle flash effects and recoil
- ๐จ Advanced Animation System using FBX animations with smooth transitions
- ๐ Physics-Based Gameplay powered by Rapier physics engine
- ๐ฑ Responsive Controls supporting both keyboard and potential gamepad input
- ๐๏ธ Modular Architecture with clean separation of concerns
- Node.js 16+ and pnpm (recommended) or npm/yarn
- Modern web browser with WebGL support
-
Clone the repository
git clone https://github.com/Soham1803/third-person-shooter-controls.git cd third-person-shooter-controls
-
Quick setup (recommended)
pnpm run setup
Or install dependencies manually:
pnpm install # or alternatively npm install # or yarn install
-
Start the development server
pnpm run dev:watch # Recommended: Auto-rebuilds package + demo # or alternatively pnpm run dev # Just demo # or npm run dev # or yarn dev
-
Open your browser and navigate to
http://localhost:5173
Key | Action |
---|---|
W/A/S/D |
Move forward/left/backward/right |
F (hold) |
Run |
Space |
Jump |
Mouse |
Look around |
Right Click (hold) |
Zoom/Aim |
Left Click |
Shoot |
โโโ package/ # ๐ฆ NPM Package Source
โ โโโ src/
โ โ โโโ Player.tsx # Main player component
โ โ โโโ index.ts # Package entry point
โ โ โโโ modules/player/ # Modular player systems
โ โ โโโ constants.ts # Game configuration
โ โ โโโ types.ts # TypeScript interfaces
โ โ โโโ camera.ts # Camera positioning & collision
โ โ โโโ movement.ts # Player movement logic
โ โ โโโ jump.ts # Jump mechanics
โ โ โโโ shooting.ts # Weapon system
โ โ โโโ recoil.ts # Camera recoil effects
โ โ โโโ muzzleFlash.ts # Visual effects
โ โ โโโ physics.ts # Physics integration
โ โ โโโ textures.ts # Texture utilities
โ โ โโโ useAnimationSetup.ts # Animation management
โ โโโ dist/ # Built package files
โ โโโ package.json # Package configuration
โ โโโ README.md # Package documentation
โโโ demo/ # ๐ฎ Live Demo Application
โ โโโ src/
โ โ โโโ App.tsx # Demo app component
โ โ โโโ CustomPlayerExample.tsx # Usage examples
โ โโโ public/
โ โ โโโ models/ # 3D models (.glb)
โ โ โโโ animations/ # Animation files (.fbx)
โ โ โโโ sfx/ # Sound effects
โ โ โโโ vfx/ # Visual effect textures
โ โ โโโ svgs/ # UI assets
โ โโโ package.json # Demo app configuration
โโโ docs/ # ๐ Documentation
โ โโโ getting-started.md # Quick start guide
โ โโโ asset-integration.md # Asset customization guide
โโโ package.json # Workspace configuration
โโโ pnpm-workspace.yaml # pnpm workspace setup
โโโ README.md # This file
We welcome contributions from developers of all skill levels! Whether you're fixing bugs, adding features, improving documentation, or sharing ideas, your contributions make this project better.
- ๐ Bug Reports - Found something broken? Let us know!
- โจ Feature Requests - Have ideas for cool new features?
- ๐ง Code Contributions - Fix bugs or implement new features
- ๐ Documentation - Help improve our docs
- ๐จ Assets - Contribute 3D models, animations, or sound effects
- ๐งช Testing - Help test the game on different devices/browsers
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Make your changes
- Test your changes thoroughly
- Commit your changes (
git commit -m 'Add amazing feature'
) - Push to your branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- ๐ Code Style: We use ESLint and TypeScript for code quality
- ๐งช Testing: Test your changes across different browsers
- ๐ Documentation: Update documentation for new features
- ๐ฏ Performance: Keep performance in mind, especially for real-time features
- ๐๏ธ Architecture: Follow the existing modular structure
We are committed to providing a welcoming and inclusive environment for all contributors. Please be respectful, constructive, and helpful in all interactions.
- React Three Fiber - React renderer for Three.js
- Three.js - 3D graphics library
- Rapier - Fast 2D and 3D physics engine
- TypeScript - Type-safe JavaScript
- Vite - Fast build tool and dev server
- React - UI library
- ๐ฎ Gamepad/Controller support
- ๐ต Enhanced audio system
- โจ Enhanced VFX - bullet trails, hit sparks, improved muzzle flash
- ๐ซ Additional weapon compatibility and variety
- ๐ Achievement system
- ๐ฑ Mobile controls
- ๐จ More character models and animations
- ๐ง Settings/options menu
Installation Problems:
# If you encounter lock file errors
pnpm run reset
# If packages seem outdated
pnpm install --force
Development Issues:
# If changes aren't reflected
pnpm run dev:watch
# If build fails
pnpm run build
For more detailed troubleshooting, see CONTRIBUTING.md
This project is licensed under the MIT License - see the LICENSE file for details.
- Thanks to all contributors who help make this project better
- Three.js community for excellent documentation and support
- React Three Fiber ecosystem for amazing tools and examples
- GitHub Issues: For bug reports and feature requests
- Discussions: For questions and community chat
Ready to contribute? Check out our issues page for beginner-friendly tasks or propose your own ideas! ๐