Skip to content

gspetillo/cv-game-controller

Repository files navigation

Computer Vision - Game Controller

Game controller using webcam made with computer vision - Python and openCv

alt text

Video Testing avaiable on https://drive.google.com/file/d/1n6ne1MEXkC8eL9NN0Hjf7Kt4hUbVqlOZ/view?usp=sharing

Requirements

Install requirements:

pip install -r requirements.txt

Get Started

  • Script file using webcam gameController.py
python gameController.py
  • Notebook explaing the functions notebook/gameControllerNotebook.ipynb

Actions

Keys

keys = {
    'A': pynput.keyboard.KeyCode.from_char('a'),  
    'D': pynput.keyboard.KeyCode.from_char('d'),  
    'W': pynput.keyboard.KeyCode.from_char('w'),  
    'S': pynput.keyboard.KeyCode.from_char('s'),  
}

A = ⬅

  • Pressed when angle is positive

D = ➡

  • Pressed when angle is negative

W = ⬆

  • Pressed when mass is bigger than 5000

S = ⬇

  • Pressed when mass is less than 3000

Controller Image

You have to use this image to control your car (or horse):

Volante

Image avaiable on ./images/steeringwheel.jpeg



Developed by Jean Jacques and Gabriel Petillo

About

Computer Vision Game Controller using Webcam developed in Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors