Yggdrasill501/ai_game

Flappy birdy game where player controls the bird by hands captured by camera.

0

stars

43

commits

Python

primary language

Sep 6, 2024

updated

README

Flappy Bird with Hand Gesture Control

This is a modified version of the classic Flappy Bird game, where the bird is controlled using hand gesture detection. The detection is powered by NVIDIA Jetson Nano using the detectNet model from the jetson-inference library. The camera captures hand movements, and the game responds by making the bird "jump" based on the position of your hand.

Requirements

To run this project, you need the following:

  • Hardware:

    • NVIDIA Jetson Nano or any Jetson device with CUDA support
    • Camera (connected to /dev/video0)
  • Software:

    • Python 3.6+
    • Pygame 2.6.0
    • NVIDIA Jetson Inference libraries
    • GStreamer 1.20.3 or higher

Jetson Libraries Setup

Ensure that the Jetson Inference library is properly installed. Follow the instructions from the official NVIDIA repository:

Installation

  1. Clone the repository and navigate into the project directory:
git clone <your-repository-url>
cd <project-directory>
  1. Ensure your camera is connected and recognized at /dev/video0. You can check if the camera is connected by running:
ls /dev/video0

If it doesn’t show, check your camera connection and permissions.

  1. Grant permissions to access the camera device:
sudo chmod 777 /dev/video0
  1. Ensure you have the necessary dependencies installed (Jetson libraries, Pygame, etc.).

  2. Modify the settings.py file to suit your configuration if necessary (e.g., camera resolution, detection model).

Running the Game

Once the setup is complete, you can start the game:

python3 main.py

Game Controls

  • Hand Gesture Control: Raise your hand in front of the camera to make the bird jump.
  • Mouse Click: Alternatively, you can use the left mouse button to control the bird.
  • Restart Game: After the game is over, click the restart button to play again.

Contributors

Yggdrasill501

43 commits

Yggdrasill501/ai_game

Flappy birdy game where player controls the bird by hands captured by camera.

0

stars

43

commits

Python

primary language

Sep 6, 2024

updated

README

Flappy Bird with Hand Gesture Control

This is a modified version of the classic Flappy Bird game, where the bird is controlled using hand gesture detection. The detection is powered by NVIDIA Jetson Nano using the detectNet model from the jetson-inference library. The camera captures hand movements, and the game responds by making the bird "jump" based on the position of your hand.

Requirements

To run this project, you need the following:

  • Hardware:

    • NVIDIA Jetson Nano or any Jetson device with CUDA support
    • Camera (connected to /dev/video0)
  • Software:

    • Python 3.6+
    • Pygame 2.6.0
    • NVIDIA Jetson Inference libraries
    • GStreamer 1.20.3 or higher

Jetson Libraries Setup

Ensure that the Jetson Inference library is properly installed. Follow the instructions from the official NVIDIA repository:

Installation

  1. Clone the repository and navigate into the project directory:
git clone <your-repository-url>
cd <project-directory>
  1. Ensure your camera is connected and recognized at /dev/video0. You can check if the camera is connected by running:
ls /dev/video0

If it doesn’t show, check your camera connection and permissions.

  1. Grant permissions to access the camera device:
sudo chmod 777 /dev/video0
  1. Ensure you have the necessary dependencies installed (Jetson libraries, Pygame, etc.).

  2. Modify the settings.py file to suit your configuration if necessary (e.g., camera resolution, detection model).

Running the Game

Once the setup is complete, you can start the game:

python3 main.py

Game Controls

  • Hand Gesture Control: Raise your hand in front of the camera to make the bird jump.
  • Mouse Click: Alternatively, you can use the left mouse button to control the bird.
  • Restart Game: After the game is over, click the restart button to play again.

Contributors

Yggdrasill501

43 commits

Languages

Python

34.3%

C++

34.1%

CSS

7.7%

Shell

6.5%

Dockerfile

3.5%

Jupyter Notebook

3.2%

HTML

2.8%

JavaScript

2.5%

Cuda

2.5%

Mojo

1.5%