ONSLAUGHT
A Java-based face recognition login system using JavaFX and OpenCV. Supports real-time face detection via webcam, face registration, and custom matching logic without LBPH. Modular, GUI-driven, and fully portable with relative paths for GitHub compatibility.
Install / Use
/learn @OG-SCARCE/ONSLAUGHTREADME
💥 ONSLAUGHT
A JavaFX + OpenCV Powered Face Recognition Login System with a 2D Shooter Game
📘 Overview
ONSLAUGHT is a modular, GUI-based Java application that blends real-time face recognition using OpenCV with an interactive 2D top-down shooter game. Built entirely with JavaFX, it supports face registration, login with image-based comparison, and a classic shooter gameplay experience. Designed for portability, the system uses relative paths—making it fully GitHub-compatible.
🧩 Features
🔐 Face Recognition Login
- 🎥 Real-time face detection with OpenCV
- 🧠 Image-based login system (custom logic, no LBPH)
- 👤 Multiple image capture per user during registration
- 📸 Integrated webcam feed and bounding box
- 🎨 Clean, responsive GUI built using JavaFX
- 💾 Organized folder system (
registered_faces/) - 🔁 Multiple login attempts and retry mechanism
- 🗃️ Optional integration with file/database for user info
- ✅ GitHub-ready: zero hardcoded paths
🎮 2D Java Shooter Game
- 🔫 Classic top-down shooter mechanics
- 🖱️ Mouse-driven aiming and shooting
- 👾 Enemy spawning and bullet collisions
- 🌟 Basic animation and real-time scoring
📸 Screenshots
<p align="center"> <img src="ONSLAUGHT (REQUIRED FILES)/OPEN_CV/PROJECT SCREENSHOTS/ (12).jpg" width="400"/> <img src="ONSLAUGHT (REQUIRED FILES)/OPEN_CV/PROJECT SCREENSHOTS/ (23).jpg" width="400"/> <br> <img src="ONSLAUGHT (REQUIRED FILES)/OPEN_CV/PROJECT SCREENSHOTS/ (22).jpg" width="400"/> <img src="ONSLAUGHT (REQUIRED FILES)/OPEN_CV/PROJECT SCREENSHOTS/ (16).jpg" width="400"/> </p>👨💻 Contributors
| Name | Role | GitHub | |-------------------|---------------------------|---------------------------------------------| | Aman Patel | Project Lead & Developer | OG-SCARCE | | Smith Shukla | Documentation & Reviewer | Smith63063 | | Kaustubh Kumar | JavaFX Developer | kaushtubhk |
🎯 Course Criteria Breakdown
| 📂 Section | ✅ Marks | |------------------------------------|---------| | 💪 Development Setup | 2 | | ✨ Project Structure | 1 | | 📃 Recognition Mechanism | 1 | | 📂 Folder Organization | 1 | | 🧪 Face Recognition Logic | 3 | | 🎮 Game Module | 3 | | 🎨 UI/UX Enhancements | 4 | | 🏅 Component Placement | 2 | | ⌘ Responsiveness & Accessibility | 2 |
⚙️ Development Setup
📌 Prerequisites
-
Java SE Development Kit 23
Download JDK 23 -
IntelliJ IDEA Community Edition 2023+ (recommended)
Alternatives: Eclipse or VS Code with JavaFX plugins
🗂 Project Structure
ONSLAUGHT (FACE RECOGNITION)/src/Main.java→ Main launcherFaceRegistration.java→ Handles face image captureFaceLogin.java→ Authenticates usersonslaught/shooterGame/GameMain.java→ Entry point for shooter gameregistered_faces/→ Stores user face imagesresources/→ FXML, CSS, and assetsopencv/→ Native OpenCV librariesgame/→ Game logic and resources
🔍 Face Recognition Logic
- No LBPH used – Implements custom OpenCV image comparison
- Registration captures multiple facial images (for robustness)
- Login matches real-time camera frames to registered images
- Modular and readable class design (
FaceDetection,FaceLogin, etc.)
🎨 UI & Game Design
- Built with JavaFX FXML and CSS
- Screens: Login, Register, Admin Panel, Game Screen
- Game logic uses AWT/Swing for simplicity and responsiveness
- Styled with modern layouts: GridPane, VBox, etc.
- Includes feedback dialogs, tooltips, and responsive resizing
🔧 Installation & Running Guide
📥 1. Download the Code
- Visit the GitHub Repository:
🔗 ONSLAUGHT GitHub Repo - Click on Code > Download ZIP 📦
- Save the ZIP file to your Desktop 🖥️
📂 2. Extract the Code
- Extract the ZIP file on the Desktop itself.
- You’ll get a folder named: ONSLAUGHT-main
- Open it — inside you’ll find another folder also named: ONSLAUGHT-main
- ✅ Rename this inner folder to: ONSLAUGHT
🛠️ 3. Prepare the Project
- Open the ONSLAUGHT folder
- Right-click inside and Copy the full path 📋
💻 4. Open IntelliJ IDEA
- Go to File > New > Project from Existing Sources
- Paste the copied path and open the folder.
- Click Next ➡️ then again Next
- When prompted with "Yes", click Yes ✅
- Wait for files to load completely ⏳
- Click Unmark All, then only select the first two files 🗂️
- Click Next ➡️ → wait for searching to complete
- Keep clicking Next ➡️
- Choose Reuse, then click Create
- Let the project open in a new window
⚙️ 5. Setup the Run Configuration
-
Go to:
ONSLAUGHT (FACE RECOGNITION) ➡️ src ➡️ Main.java
Double-click to open it. -
Go to Edit Configurations 🛠️
- Click + Add New Configuration → Select Application
- Name: ONSLAUGHT
- ✅ Enable: Store as project file
-
Configure:
- Module: Select JDK 23 ☕
- -cp: Set to "ONSLAUGHT (FACE RECOGNITION)"
- Main class: Select Main from the same folder
-
Click Modify Options:
-
Enable Add VM Options under Java section
-
Paste the following path in VM Options:
--module-path "../ONSLAUGHT (REQUIRED FILES)/OPEN_CV/JAVA SDK/lib" --add-modules javafx.controls,javafx.fxml
-
-
Set Working Directory to ONSLAUGHT (FACE RECOGNITION) 📁
-
Click Apply, then OK
▶️ 6. Run the Application
- Hit the green Play button to run the ONSLAUGHT application 🎉
😄 7. Register with Face
- Click Register with Face 📸
- Enter your username in IntelliJ Terminal
- Allow Camera Access 🎥
- Wait while the application captures 10 facial images
🔐 8. Login with Face
- Click Login with Face
- If successfully registered, you’ll be allowed to play the game 🎮
❗ Note: If not registered, login won’t proceed.
🛡️ 9. Admin Login Option
- For administrator access:
- 👤 Username: admin
- 🔑 Password: 1234
- Click Login
🚀 10. Start the Game
- Click Start Game
- If the game window doesn’t appear instantly:
- Click Minimize 🗕, then reopen from the Taskbar 📌
🏆 11. Enjoy!
- You’re now ready to play and enjoy ONSLAUGHT
- Don’t forget to check your High Score after each session 🥇
💡 Contribute
- Fork the repo
- Make your changes
- Submit a pull request 🚀
🌟 Developed with 💻 and ☕ by OG-SCARCE
“From face recognition to fast-paced fun — welcome to ONSLAUGHT.”
