A lightweight 3D basketball game where players swipe up on a basketball to shoot it into a hoop, built with Three.js.
This game simulates a simple basketball shooting experience. Players interact with a 3D basketball by swiping upward on their device to shoot the ball toward a hoop. The game uses realistic physics to simulate the ball's trajectory, bouncing, and interaction with the hoop and backboard.
- 3D rendering with Three.js
- Realistic ball physics using Ammo.js (Bullet physics)
- Swipe-to-shoot mechanics for mobile and desktop
- Score tracking
- Responsive design that works across devices
- Frontend: HTML5, CSS3, JavaScript
- 3D Rendering: Three.js
- Physics Engine: Ammo.js
- Build Tools: Webpack/Vite
- Node.js (v14+)
- npm or yarn
-
Clone the repository
git clone https://github.com/yourusername/basketball-swipe-game.git cd basketball-swipe-game -
Install dependencies
npm install -
Run development server
npm run dev -
Build for production
npm run build
├── src/ │ ├── index.html │ ├── js/ │ │ ├── main.js │ │ ├── game/ │ │ │ ├── Game.js │ │ │ ├── Ball.js │ │ │ ├── Hoop.js │ │ │ ├── Physics.js │ │ │ └── Controls.js │ │ └── utils/ │ │ └── helpers.js │ ├── assets/ │ │ ├── models/ │ │ ├── textures/ │ │ └── sounds/ │ └── style.css ├── public/ ├── package.json ├── docs/ │ ├── README.md │ ├── CONTRIBUTING.md │ ├── ARCHITECTURE.md │ └── MECHANICS.md └── .gitignore