java.lang.Object
com.slinky.hackmaster.model.GameConstants
The
GameConstants
class defines a set of constants used throughout
the game application. These constants include the starting number of guesses
a player has, the default font size for text rendering, and the Font
object used within the application's UI.
This class is designed to centralise these key configuration values, ensuring they are consistently used across the application and can be easily referenced or modified if needed (except for final fields which are immutable).
This class is not meant to be instantiated, but rather serves as a convenient container for game-related constants that are commonly referenced in the application's logic and UI components.
- Author:
- Kheagen Haskins
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final javafx.scene.paint.Color
The color for the game's backgroundstatic final int
The constant height of the cell view in pixels.static final int
The constant width of the cell view in pixels.static final javafx.scene.text.Font
TheFont
object representing the font used in the application.static final int
The default font size used for theFont
object in the application.static final javafx.scene.paint.Color
The main foreground to be used throughout the game.static final int
The number of guesses the user starts with. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
STARTING_GUESSES
public static final int STARTING_GUESSESThe number of guesses the user starts with. This value is set to 4 and is a constant throughout the game.- See Also:
-
FONT_SIZE
public static final int FONT_SIZEThe default font size used for theFont
object in the application. This size is set to 16 by default and cannot be changed as it is a final field.- See Also:
-
FONT
public static final javafx.scene.text.Font FONTTheFont
object representing the font used in the application. This font is loaded from the resources if available, otherwise it defaults to a monospaced font with the specifiedFONT_SIZE
. -
FOREGROUND
public static final javafx.scene.paint.Color FOREGROUNDThe main foreground to be used throughout the game. -
BACKGROUND
public static final javafx.scene.paint.Color BACKGROUNDThe color for the game's background -
CELL_WIDTH
public static final int CELL_WIDTHThe constant width of the cell view in pixels. This defines the preferred width of theCellView
when displayed in the user interface.- See Also:
-
CELL_HEIGHT
public static final int CELL_HEIGHTThe constant height of the cell view in pixels. This defines the preferred height of theCellView
when displayed in the user interface.- See Also:
-
-
Constructor Details
-
GameConstants
public GameConstants()
-