Skip to content

The 1st place project of Hack112 Fall 2022 at Carnegie Mellon University out of 200 participants. A computer vision controlled fighting game with hit priority, combo, and timing mechanics, full animation, and playable levels.

Notifications You must be signed in to change notification settings

KyleleeSea/slashnbash

Repository files navigation


slash n bash

A computer vision controlled fighting game with hit priority, combo, and timing mechanics, full animation, and playable levels.


About The Project

Imgur "slash n bash" is a side-scrolling retro themed fighting game controlled by real life body movement.

The project was ideated, designed, and implemented in less than 24 hours for the Carnegie Mellon Hack112 challenge. The project won 1st place out of 200 participants.

Features

  • Pose estimation controlled action.
  • 9 playable and distinct levels with increasing difficult enemies.
  • Smooth level transitioning with parallax background and walk animations.
  • Fully animated blocks, attacks, hits, walks, idles, deaths, and more.
  • Balanced and playtested fighting mechanics with hit priority, block counterdamage to discourage move spam, and designed for an emphasis on timing/rhythm.
  • Full sound effects and background music.
  • Levels designed to progressively teach user the game mechanics.
  • Instructions, start, win, and death splash screens.

Design principles

  1. Make the user truly feel like a powerful sword wielding fighter.
  2. Mirror virtual game to player real life pose as accurately as possible.
  3. Provide strong enough challenge where level completion feels like an accomplishment.

Gameplay Instructions

  • Move hands above head to perform a "down slash" attack Imgur

  • Move hands from right to left to perform a slash attack Imgur

  • Turn back to camera to block Imgur

Built With

  • OpenCV
  • MediaPipe
  • Py Auto GUI
  • PyGame
  • [Tkinter][tkiner-url]

Local Copy

You may run this project locally by following these steps:

  1. Clone the repo
    git clone https://github.com/KyleleeSea/slashnbash
  2. Create, set up new virtual environment
python -m venv myvenv #create environment
  1. Install external modules
  2. OpenCV: enables image processing and webcam access
  3. mediapipe: enables pose estimation model
  4. pyautogui: allows python script to access and controll keyboard
pip install opencv-python
pip install mediapipe
pip install pyautogui
  1. Make sure tikinter is downloaded from cmu_112_graphics.py on the CMU 15-112 website.
import sys
print(f"sudo '{sys.executable}' -m pip install pillow")
print(f"sudo '{sys.executable}' -m pip install requests")
  1. Run run.py
python3 run.py

Contact

Twitter - @KyleleeSea

Project Link: https://github.com/KyleleeSea/slashnbash

Contributors

About

The 1st place project of Hack112 Fall 2022 at Carnegie Mellon University out of 200 participants. A computer vision controlled fighting game with hit priority, combo, and timing mechanics, full animation, and playable levels.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published