Skip to content

Carnegie Mellon Hack112 1st Place Winner. A classic fighter game, implementing both manual and computer vision inputs with PyGame, OpenCV, and TensorFlow.

Notifications You must be signed in to change notification settings

R-Malik/hack112

Repository files navigation

FARNAMS FIGHT OFF

🏆 Carnegie Mellon 15-112 Hackathon 1st Place Winner

Our game, FARNAMS FIGHT OFF, is a two-player fighter game based on the beloved Street Fighter classics, with an innovative twist. You can choose to play with normal keyboard controls with each player on either side of the keyboard. OR have one player play with ✨computer vision✨ while the other uses the keyboard.

NOTE: This project was created for educational purposes within Carnegie Mellon University and NOT intended for commercial use. Permission to sell, license, sublicense, publish, or distribute this software without permission from the authors is NOT granted unless it falls under Fair Use. No warranty is provided for copies of this software. Character assets are property of CAPCOM and the jump sound effect is property of Nintendo.

🕹️ Player Controls for Pat

W, A, S, D --> up, left, down, right
E, R, T --> block, punch, kick

🕹️ Player Controls for Mike

⬆, ⬅, ⬇, ▶ --> up, left, down, right
M, COMMA, PERIOD --> block, punch, kick

🎥 Player Controls for Pat (VISION)

Please stand about 3-4 feet away from the webcam on your computer, face in the same direction as the character, and try to stay to in frame. The following inputs are pretty straightforward:

JUMP --> jump
PUNCH --> punch
LEAN FORWARD --> right
LEAN BACK --> left
CROUCH --> crouch

💾 Installation

Make sure your Python has certificates installed, so tensorflow can make an http request to download the training model.

run main.py
run light.py         # if you don't want computer vision

If packages are missing, install them manually:

pip install pygame
pip install pygame.locals
pip install tensorflow
pip install tensorflow_hub
pip install numpy
pip install cv2
pip install math

💻 Authors

Rahim Malik (rahimm@andrew.cmu.edu)
Kenneth Sorrell (ksorrel2@andrew.cmu.edu)

❤️ Special Thanks

James Tcheng (ztcheng@andrew.cmu.edu)

🔗 References

https://www.pygame.org/docs/
https://www.tensorflow.org/hub/tutorials/movenet

🗿 Models + Assets

https://tfhub.dev/google/movenet/singlepose/lightning/4
https://www.fontspace.com/mad-homie-font-f75185
https://www.spriters-resource.com/fullview/117308/
https://www.spriters-resource.com/arcade/streetfighter2/sheet/60224/
https://pbs.twimg.com/media/EZHwgYUVcAAwpS3.jpg
https://www.myinstants.com/en/index/us/

About

Carnegie Mellon Hack112 1st Place Winner. A classic fighter game, implementing both manual and computer vision inputs with PyGame, OpenCV, and TensorFlow.

Topics

Resources

Stars

Watchers

Forks

Languages