Class GameApp

java.lang.Object
javafx.application.Application
game.GameApp

public class GameApp extends javafx.application.Application
Main game application class for JavaFX Bullet Hell. Handles the game loop, rendering, input, and player/room management.
  • Nested Class Summary

    Nested classes/interfaces inherited from class javafx.application.Application

    javafx.application.Application.Parameters
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private boolean
    Flag to track if the game is over
    private boolean
    Flag to ensure game-over sound effect only plays once
    private boolean
    Flag to track if the game has started
    static final double
    Game canvas height
    private javafx.scene.text.Font
    Font used for HUD and screens
    private Player
    Reference to the player object
    private RoomManager
    Room manager singleton
    static final double
    Game canvas width

    Fields inherited from class javafx.application.Application

    STYLESHEET_CASPIAN, STYLESHEET_MODENA
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private void
    drawDeadScreen(javafx.scene.canvas.GraphicsContext gc)
    Draws the death/game-over screen with score and restart instructions.
    private void
    drawHUD(javafx.scene.canvas.GraphicsContext gc)
    Draws the heads-up display (HUD) including HP bar and coin counter.
    private void
    drawStartScreen(javafx.scene.canvas.GraphicsContext gc)
    Draws the start screen with instructions.
     
    static void
    main(String[] args)
    Application entry point.
    private void
    Resets game state and player/room manager for a new game.
    void
    start(javafx.stage.Stage stage)
    Initializes and starts the JavaFX application.

    Methods inherited from class javafx.application.Application

    getHostServices, getParameters, getUserAgentStylesheet, init, launch, launch, notifyPreloader, setUserAgentStylesheet, stop

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • gameStarted

      private boolean gameStarted
      Flag to track if the game has started
    • gameOver

      private boolean gameOver
      Flag to track if the game is over
    • gameOverSFXPlayed

      private boolean gameOverSFXPlayed
      Flag to ensure game-over sound effect only plays once
    • player

      private Player player
      Reference to the player object
    • WIDTH

      public static final double WIDTH
      Game canvas width
      See Also:
    • HEIGHT

      public static final double HEIGHT
      Game canvas height
      See Also:
    • roomManager

      private RoomManager roomManager
      Room manager singleton
    • pixelFont

      private javafx.scene.text.Font pixelFont
      Font used for HUD and screens
  • Constructor Details

    • GameApp

      public GameApp()
  • Method Details

    • main

      public static void main(String[] args)
      Application entry point.
      Parameters:
      args - Command-line arguments
    • getPlayer

      public Player getPlayer()
      Returns:
      The player instance
    • start

      public void start(javafx.stage.Stage stage)
      Initializes and starts the JavaFX application.
      Specified by:
      start in class javafx.application.Application
      Parameters:
      stage - The primary stage provided by JavaFX
    • restartGame

      private void restartGame()
      Resets game state and player/room manager for a new game.
    • drawStartScreen

      private void drawStartScreen(javafx.scene.canvas.GraphicsContext gc)
      Draws the start screen with instructions.
      Parameters:
      gc - GraphicsContext for drawing
    • drawDeadScreen

      private void drawDeadScreen(javafx.scene.canvas.GraphicsContext gc)
      Draws the death/game-over screen with score and restart instructions.
      Parameters:
      gc - GraphicsContext for drawing
    • drawHUD

      private void drawHUD(javafx.scene.canvas.GraphicsContext gc)
      Draws the heads-up display (HUD) including HP bar and coin counter.
      Parameters:
      gc - GraphicsContext for drawing