The Stick Hero Game is a Java application that offers an immersive gaming experience. Players control a stick to navigate platforms and progress through different levels. The game features extending and falling sticks, hero walking animations, and platform shifting.
The project is organized into key classes and interfaces:
- GameController: Manages overall game logic, including stick and hero actions.
- BaseController: Serves as a base controller class for the game.
- RectangleLengthExtension: Provides functionality for vertically extending the stick.
- Stick: Represents the stick in the game.
- Hero: Represents the game character (hero) in Stick Hero.
- GamePauseController: Manages the game pause screen.
- Shift Platform: Moves the game platforms horizontally.
- Start Extension: Initiates stick extension when the mouse is pressed.
- Pause Game: Pauses the game and navigates to the pause screen.
- Quit Game: Quits the game and returns to the home page.
- Extend Stick Vertically: Allows the player to vertically extend the stick.
- Fall Stick: Simulates the fall of the stick after extension.
- Hero Walk: Animates the hero's walking movement.
- The initial stick height is set to 0.0.
- Flags (e.g.,
stick_extend_flag
,stick_fall_flag
) control the game's flow. - Specific conditions trigger stick extension, falling, and hero walking.
- The
platformShiftSpeed
variable controls the speed of platform movement. - Various flags control hero animations and platform translations.
- Inheritance:
BaseController
is extended byGameController
, demonstrating the inheritance concept. - Polymorphism:
GameController
uses various methods for stick and hero actions, showcasing polymorphic behavior. - Abstraction:
Stick
andHero
classes abstract the complexity of stick and hero actions, providing a higher-level view. - Encapsulation: Private fields and methods encapsulate the internal state and behavior of
GameController
and related classes. - Composition: The
GameController
class uses composition to manageStick
andHero
instances, creating a more modular design. - Multithreading: Implemented while using sound effects.
- JUnit Tests: Three JUnit tests have been written to ensure code correctness.
- FXML Integration: All pages are linked and switched using FXML files.
- Component Reusability: Appropriate components like hero generation have been taken into account for a more modular design.