Skip to content

mmbaguette/Fruit-Ninja-3D

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

10 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Fruit Ninja 3D (using webcam) ๐Ÿ‰

Fruit Ninja in pygame using pose estimation in MediaPipe.

How to Play:

Setup requires technical skills with Python.

Copy this GitHub repository, and run fruit_ninja.py with Python 3. You need to know how to install Python, and run scripts in the terminal. Make sure your current working directory is the main fruit ninja folder and not scripts. Install the dependencies below in the terminal using the pip command. Press the Esc key to exit.

Gameplay:

fruit ninja

Features:

  • Fruits:
    • Pineapple ๐Ÿ
    • Watermelon ๐Ÿ‰
    • Kiwi ๐Ÿฅ
    • Orange ๐ŸŠ
    • Bomb ๐Ÿ’ฃ
  • Black knife trail cuts anything it touches (cut several fruits at the same time)
  • Start menu (hands up before playing to avoid accidentally starting)
  • Preview webcam video while playing by changing the SHOW_WEBCAM setting in fruit_ninja.py (True/False)

alt text

Dependences:

pip install pygame 
pip install opencv-python
pip install git+https://github.com/google-ai-edge/mediapipe.git@v0.8.9

Pyinstaller (package game into an executable)

Make your own Fruit Ninja VR executable. Use this command inside the working directory (Fruit-Ninja-3D not scripts) to package the game into an exe file.

pyinstaller -w --onefile --paths="PYTHON_PATH\Python39\Lib\site-packages\cv2" --collect-data mediapipe --add-data "PYTHON_PATH\Python39\Lib\site-packages\mediapipe;mediapipe" -i "images/icon.ico" scripts/fruit_ninja.py

Install pyinstaller if you haven't already:

pip install pyinstaller

About

Fruit Ninja in pygame using pose motion tracking in MediaPipe.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages