Skip to content

๐ŸŽฎ Computer Vision Games in Python! Hill climbing racing with hand detection, stack builder, pin pong ball, and dino game. Explore immersive gameplay with cutting-edge tech. Join me on this coding adventure! ๐Ÿš€

License

Notifications You must be signed in to change notification settings

alok-ahirrao/Playing_with_Computer_Vision

Repository files navigation

Playing with Computer Vision

SQBBF.gif

GUI

Game photo

Games Overview:

  1. Tower Building

  2. Hill Climb Racing

  3. Dino Game

    • Play Dino Game Online (Simply search "Dino Game" in Google for offline play or play directly in your browser when disconnected from the internet!)
  4. Pong Classic

    • This game is built in the project code using OpenCV. Itโ€™s a classic Pong game where you control paddles with hand gestures.

Features:

  • Hand Gesture Recognition using OpenCV and MediaPipe.
  • Key Simulation through custom key press libraries.
  • Interactive GUI to select and play different games.

Game photo Game photo Game photo Game photo


Files and Formats:

/my-project
โ”‚
โ”œโ”€โ”€ .idea/                  # IDE configuration files (used by JetBrains IDEs like PyCharm)
โ”œโ”€โ”€ Resources/              # Folder containing all background images and game-related assets
โ”‚   โ”œโ”€โ”€ Background.png      # Background image used in the GUI
โ”‚   โ””โ”€โ”€ gameOver.png        # Game over screen image
โ”œโ”€โ”€ __pycache__/            # Automatically generated folder by Python containing compiled bytecode files
โ”œโ”€โ”€ img_re/                 # Folder for storing image-related resources
โ”‚   โ”œโ”€โ”€ dino.png            # Example image for the Dino game
โ”‚   โ””โ”€โ”€ pong_ball.png       # Example image for the Pong game
โ”œโ”€โ”€ .gitattributes          # Git configuration file for line endings and attributes
โ”œโ”€โ”€ GUI.py                  # Python script for the Graphical User Interface (GUI)
โ”œโ”€โ”€ README.md               # Project documentation
โ”œโ”€โ”€ directkeys1.py          # Python script for simulating key presses for Game 1
โ”œโ”€โ”€ directkeys2.py          # Python script for simulating key presses for Game 2
โ”œโ”€โ”€ directkeys3.py          # Python script for simulating key presses for Game 3
โ”œโ”€โ”€ game1.png               # Image file (PNG format) used for displaying the button for Game 1
โ”œโ”€โ”€ game2.png               # Image file (PNG format) used for displaying the button for Game 2
โ”œโ”€โ”€ game3.png               # Image file (PNG format) used for displaying the button for Game 3
โ”œโ”€โ”€ game4.png               # Image file (PNG format) used for displaying the button for Game 4
โ”œโ”€โ”€ hand_landmarks.png      # Image file (PNG format) used for visualizing hand landmarks
โ”œโ”€โ”€ main.py                 # Python script that runs the game control system
โ””โ”€โ”€ requirements.txt        # File listing all the dependencies for the project

How to Run:

  1. Run the Game GUI:

    • To start the game, run main.py first. This will launch the GUI where you can select the game.
    python main.py
  2. Select a Game:

    • You will see the four game options in the GUI:
      • Tower Building
      • Hill Climb Racing
      • Dino Game
      • Pong Classic
  3. Control the Game:

    • Hand gestures will control the game.
    • Use gestures to simulate pressing keys like "Space" for jumping, "Enter" for selecting, or "Left/Right arrows for movement, depending on the game selected.
  4. Libraries:

    • Install the required libraries by running:
      pip install -r requirements.txt
  5. Game Control:

    • The games are controlled using hand gestures detected through OpenCV and MediaPipe.

Conclusion

This project demonstrates how to build a hand-gesture-controlled gaming system using OpenCV and MediaPipe. By using this directory structure and the accompanying Python scripts, you can easily manage the assets, game logic, and interface for an interactive game.

About

๐ŸŽฎ Computer Vision Games in Python! Hill climbing racing with hand detection, stack builder, pin pong ball, and dino game. Explore immersive gameplay with cutting-edge tech. Join me on this coding adventure! ๐Ÿš€

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages