(university project)
BasketBox is an interactive AI-powered basketball box simulation using Python, Pygame, Pymunk, OpenCV, and MediaPipe. Control virtual boxes with your hand gestures detected by your webcam!
- Real-time hand tracking and gesture recognition
- Physics-based box movement
- Interactive basketball court background
- Splash screen before starting
- Easy-to-use controls
- Python version: 3.11.x (recommended)
- Operating System: Windows (tested), compatible with other OS with minor changes
- pygame
- pymunk
- mediapipe
- opencv-python
-
Clone the repository:
git clone <repo-url> cd BasketBox
-
(Optional) Create a virtual environment:
python -m venv venv venv\Scripts\activate -
Install dependencies:
pip install -r requirements.txtIf you don't have a
requirements.txt, install manually:pip install pygame pymunk mediapipe opencv-python -
Add images: Place the following images in the
images/folder:logoWhite.png(logo)splash.png(splash screen)caja.png(box)basketball.png,cesped.png(optional backgrounds)
-
From the project root, run:
python -m src.BasketBox.mainOr, if you have a main script:
python juego.py
-
Controls:
- Press SPACE to start from splash screen
- Use your hand to interact with boxes (make a fist to grab)
- Press ESC or close window to exit
BasketBox/
โ README.md
โ requirements.txt
โ pyproject.toml
โ setup.cfg
โ
โโโ images/
โ logoWhite.png
โ splash.png
โ caja.png
โ cancha.png
โ basketball.png
โ cesped.png
โ
โโโ src/
BasketBox/
__init__.py
main.py
...
- Code is modular and commented in English
- Uses constants for hand connections for clarity
- Splash screen and logo for professional look
- All dependencies listed for reproducibility
- Compatible with Python 3.11.x
Developed by Vรญctor Rodrรญguez Dorta
Enjoy BasketBox! ๐

