Stick Hero is a fun and addictive JavaFX game that tests your timing and reflexes. Grow the stick just right to help your hero cross from one platform to another — too short or too long, and you fall! Designed with clean architecture and popular design patterns (Singleton, Flyweight), this game offers both a great user experience and well-structured code for learners and contributors.
🎬 Watch the Game in Action:
🔗 Click here to view the demo on YouTube
| Main Menu | Gameplay | Game Over | Avatar Selection | Background Gallery |
|---|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
📁 Note: Ensure the screenshots are located in a
screenshots/folder within your repository.
- Game Overview
- Screens & Controllers
- Core Game Logic
- Game Features
- Getting Started
- Contributing
- GitHub Repository
- Acknowledgments
In Stick Hero, players tap and hold to grow a stick and release to let it fall across a gap between platforms. If it lands correctly, the hero walks across and the game continues. If not, it’s game over!
- Clean JavaFX architecture
- Avatar & background customization
- Use of key design patterns (Flyweight, Singleton)
- Sound effects for immersion
Manages the main menu with options to start the game, view help, or exit.
Handles all gameplay logic, stick growth, collisions, transitions, and animations.
Shows final score, and offers options to restart or go to main menu.
Displays instructions and tips to play the game effectively.
Efficiently loads and reuses avatar images using the Flyweight design pattern.
Lets players customize background themes by selecting images from a gallery.
Core class managing:
- Platform generation
- Stick creation and rotation
- Hero movement
- Score updates
- State transitions
A separate thread for stick growth animation, ensuring smooth rendering while keeping UI responsive.
Plays sound effects for:
- Stick drop
- Hero movement
- Game over events
Implements the Singleton pattern to ensure a single instance of the hero. Manages:
- Character state
- Position tracking
- Movement animations
- Java JDK 8 or later
- JavaFX SDK (if not bundled with JDK)
- Maven (optional)
-
Clone the repo:
git clone https://github.com/namit22315/STICKHERO.git cd STICKHERO -
Run with Maven:
mvn clean mvn javafx:run
-
Or open in an IDE (IntelliJ, Eclipse):
- Import project
- Set JavaFX VM options if needed
- Run the main class
Contributions:
- JavaFX UI Design (Menus, Help, Gallery, Game Over)
- Avatar & Background Customization
- Core Game Logic (Stick, Hero, Gameplay)
- Sound Effects Integration
- Singleton & Flyweight Design Patterns
🔍 Explore the codebase, raise issues, and contribute: https://github.com/namit22315/STICKHERO.git
- JavaFX — for the smooth GUI framework.
- JUnit — for testing inspiration.
- YouTube tutorials & GitHub communities — for early game dev guidance.




