Repository navigation
Releases
v4.0
Packaged jar version
๐ฎ FNaF-Themed JavaFX Quiz App
Welcome to the FNaF Quiz App, an interactive, animated quiz application inspired by Five Nights at Freddy's. Built with JavaFX, this project features a rich UI, music, GIFs, and a themed pause menu for a polished, spooky quiz experience!
๐ Getting Started
Prerequisites
- Java 21 (or higher, e.g., OpenJDK 23)
- JavaFX 21 SDK (JARs placed in the
lib/directory) - Visual Studio Code with Java Extension Pack
Project Structure
๐ quiz_app_package/
โโโ app/
โ โโโ run_app.bat # Batch file to run the quiz app
โ โโโ target/
โ โโโ quiz_app-1.0-SNAPSHOT.jar
โ โโโ original-quiz_app-1.0-SNAPSHOT.jar
โ โโโ classes/
โ โโโ ... # Compiled classes and resources
โโโ server/
โ โโโ run_server.bat # Batch file to run the server
โ โโโ target/
โ โโโ server_app-1.0-SNAPSHOT.jar
โ โโโ original-server_app-1.0-SNAPSHOT.jar
โ โโโ classes/
โ โโโ ... # Compiled server classes
โโโ javafx-sdk-23.0.2/ # JavaFX SDK (Windows)
โ โโโ lib/
โ โโโ bin/
โ โโโ ... # SDK files and legal docs
โโโ README.txt # This file
๐ How to Run
You can run the application in one way
Using the Provided Batch File (Windows)
- Double-click
run_app.batin the project root, or - Open a terminal in the project root and run:
run_app.bat
Note: The batch file assumes Java and JavaFX are properly set up and referenced.
๐ก Features
- ๐ง 10-question quiz with randomized selection
- โฑ๏ธ Countdown timer with animated progress bar
- ๐ถ Background music that loops during the quiz
- โธ๏ธ Pause menu (ESC or pause button)
- GIF background (pause.gif)
- Themed buttons: Resume, Restart, Quit
- โ Correct/incorrect answer highlighting
- ๐จ Themed UI with custom fonts and effects
- ๐ Responsive question layout
๐ Online Mode
- Connects to a server on port
12345 - Sends a
CONNECTcommand - Submits score, time, and correct answers to the server
- Receives leaderboard rankings
โ Requirements
- Java 21+ (OpenJDK recommended)
- JavaFX 21 SDK (JARs in
lib/) - VSCode with Java Extension Pack
โ๏ธ Customization
- Add questions to
src/main/resources/txt/ - Replace background music in
audio/ - Update GIFs/images in their respective folders
๐ฌ Feedback
Have suggestions or want to fork this for another theme?
Send feedback or bug reports here.
โ๏ธ Legal
This project uses JavaFX, which is licensed under the GNU General Public License, version 2, with the Classpath Exception.
All Five Nights at Freddy's references and assets are for educational/fan use only. This project is not affiliated with or endorsed by Scott Cawthon or the official FNaF franchise.
Made with ๐, ๐, and JavaFX and way too much coffee โ.
Build System Upgrade with Persistent Leaderboard Support
๐ ๏ธ Release: Maven Build, Batch Scripts & Improved Leaderboard Storage
This release introduces full Maven support, Windows batch files for easier launching, and a redesigned leaderboard storage system that now saves to a user directory on the host machine, improving persistence and portability.
โจ What's New
๐งฉ General
- โ
Maven-based build system (
pom.xmlincluded) - ๐ฆ Clean build artifacts inside
target/folder - ๐ป Batch files (
run_app.bat,run_server.bat) for quick execution with proper JavaFX paths - ๐ Leaderboard file (
leaderboard.txt) now saved under user-specific directory, e.g.:C:\Users\<username>\QuizAppData\leaderboard.txton Windows
๐ฎ Quiz App Features
- ๐ง 10-question quiz with randomized selection
- โฑ๏ธ Countdown timer with animated progress bar and color transitions (green โ orange โ red)
- ๐ถ Background music that loops during the quiz
- โธ๏ธ Pause menu (press
ESCor pause button) - ๐๏ธ GIF background (
pause.gif) - ๐จ Themed buttons: Resume, Restart, Quit
- โ Answer feedback with correct/incorrect highlighting
- ๐ Responsive layout for different screen sizes
- ๐ญ Custom fonts and JavaFX styling for immersive UI
๐ฅ๏ธ Server Features
- ๐ Leaderboard server that listens for client connections on port
12345 - ๐ฅ Accepts and processes score submissions from quiz clients
- ๐ Sends top 3 leaderboard entries back to clients
- ๐ฅ Displays connected clients in real-time
- ๐งต Handles multiple clients concurrently using threads
- ๐พ Saves leaderboard to user-specific directory for persistence
- ๐ช JavaFX GUI to start/stop the server, view logs, and track activity
๐ Project Structures
๐ quiz_app/ Project Structure
quiz_app/
โโโ .vscode/ # VSCode config files
โโโ lib/ # JavaFX JAR libraries
โโโ src/
โ โโโ main/
โ โ โโโ java/
โ โ โ โโโ bhargav/
โ โ โ โโโ App.java # Entry point
โ โ โ โโโ client/ # Client networking code
โ โ โ โโโ quiz/ # Quiz logic and GUI
โ โ โโโ resources/
โ โ โโโ audio/ # Background music
โ โ โโโ gifs/ # GIF backgrounds
โ โ โโโ images/ # UI images
โ โ โโโ txt/ # Question banks and fallback leaderboard
โ โ โโโ videos/ # Optional media
โ โโโ test/
โ โโโ java/
โ โโโ bhargav/
โ โโโ TestQuiz.java # JUnit tests
โโโ target/ # Compiled output (via Maven)
โ โโโ quiz_app-1.0-SNAPSHOT.jar
โโโ run_app.bat # Batch script to run the quiz app
โโโ pom.xml # Maven build file
โโโ UML.png # UML class diagram
โโโ README.txt # Project documentation
๐ server_app/ Project Structure
server_app/
โโโ src/
โ โโโ main/
โ โโโ java/
โ โ โโโ bhargav/
โ โ โโโ Server.java # Entry point to launch server GUI
โ โ โโโ server/
โ โ โโโ LeaderboardServer.java # Handles server logic, client threads
โ โ โโโ LeaderboardServerGUI.java# GUI for controlling server
โ โโโ resources/ # (Optional) Resource folder if needed
โโโ target/
โ โโโ server_app-1.0-SNAPSHOT.jar # Compiled server JAR
โโโ run_server.bat # Batch script to launch server with JavaFX
โโโ javafx-sdk-23.0.2/ # JavaFX SDK required for runtime
โโโ README.txt # Project documentation
๐ฆ How to Build
You can build both projects using Maven:
mvn clean packageThe compiled .jar files will appear in the target/ directory of each project.
๐ How to Run
๐น Run Quiz App
run_app.bat๐น Run Leaderboard Server
run_server.batEnsure your environment has the JavaFX SDK properly set up, or the batch files include the correct module paths.
๐ Leaderboard Data Storage
Leaderboard files are now stored in a directory like:
Windows: C:\Users\<username>\QuizAppData\leaderboard.txt
macOS/Linux: /home/<user>/QuizAppData/leaderboard.txt
This avoids overwriting files in resources/ and ensures persistence.
๐ License
This project uses JavaFX and other dependencies under their respective licenses. See the javafx-sdk-23.0.2/legal/ folder for details.
๐ Support
Open an issue on this repository for bugs, suggestions, or questions.
No build tool alpha
๐ฆ Release: Initial Manual Build Version (v1.0)
This is the first release of the Quiz App with Leaderboard Server, created without any build tools. The application was manually compiled and run using javac and java. It includes a fully interactive JavaFX-based quiz client and a threaded leaderboard server.
๐งฉ Components
This project consists of two major components:
- ๐ฅ๏ธ Quiz App (Client)
- ๐๏ธ Leaderboard Server
๐ฅ๏ธ Quiz App (Client) Features
- ๐ง 10-question quiz with randomized question selection on each run.
- โฑ๏ธ Countdown timer with an animated progress bar that changes color (green โ orange โ red).
- ๐ถ Looping background music during the quiz session.
- โธ๏ธ Pause menu accessible via the ESC key or a dedicated Pause button.
- ๐ผ๏ธ Animated GIF background (
pause.gif) shown during pause state. - ๐จ Themed UI including:
- Custom button styles: Resume, Restart, and Quit
- Highlighting of โ correct and โ incorrect answers
- Stylized fonts and drop shadows
- ๐ Responsive question layout with dynamic text wrapping and alignment.
๐๏ธ Leaderboard Server Features
- ๐ก Accepts multiple client connections and processes quiz scores in real-time.
- ๐ฅ Maintains a live leaderboard that ranks players based on score.
- ๐ Thread-safe architecture using a thread pool to manage client communication.
- ๐พ Persistent storage of scores in a file to retain leaderboard data between restarts.
- ๐งช Built-in command handling for
CONNECT,START_QUIZ, andSUBMIT_SCORE. - ๐ฅ๏ธ JavaFX GUI to:
- Start/stop the server
- Monitor logs and connected clients
- Display current leaderboard entries
๐ Project Structure
src/
โโโ App.java # Main entry point to launch the quiz client
โโโ Server.java # Entry point for the server GUI (if used)
โโโ ... # Additional packages or resources
๐ ๏ธ How to Run (Manual Compilation)
Prerequisites
- Java 8 or higher
- JavaFX SDK 23.0.2 (included in
javafx-sdk-23.0.2/)
How to run?
- Head to the App.java file in
src/, then click on run. (This requires Visual Studio Code or a similar IDE with Java set up.)
๐ File Locations
-
Leaderboard Data:
Stored in:..\AssignmentGCIS124\txt\leaderboard.txt -
Audio & GIF Assets:
Stored under a folder such asaudio/,gifs/, orresources/.
โ ๏ธ Known Limitations in v1.0
- โ No build tools (Maven/Gradle)
- โ No JAR packaging
- โ No batch scripts
- โ Manual compilation required
- โ Leaderboard file doesn't support packaging due to being package-dependent if it is to be packaged.
๐ License
JavaFX is distributed under the GPL v2 with the Classpath Exception.
See the javafx-sdk-23.0.2/legal/ folder for more details.
๐ฌ Feedback & Issues
Found a bug or have a suggestion? Open an issue or contribute your improvements!