Class Constants
java.lang.Object
fr.paris.saclay.sidescroller.utils.Constants
Utils class used to store common methods and variables.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intCamera's offset bound for left direction: when the player walks left the camera is updated before reaching the end of the screen.static final intCamera's offset bound for right direction: when the player reaches the half of the screen it stops and the camera is updated.static final intHeight of scaled tile.static final intMaximum screen's columns.static final intMaximum screen's rows.static final intSingle square size.static final intPlayer recovery timer, activated on hit.static final intPlayer maximum health points.static final intPlayer maximum stamina.static final intStamina recovery timer.static final StringPrimary color of the game's theme.static final intScale factor of the game.static final intScreen height.static final intScreen width.static final StringSecondary color of the game's theme.static final intWidth of scaled tile. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DirectiongetOppositeDirection(Direction direction) Retrieves opposite direction of the provided one (e.g.
-
Field Details
-
ORIGINAL_SQUARE_TILE
public static final int ORIGINAL_SQUARE_TILESingle square size.- See Also:
-
MAX_SCREEN_COL
public static final int MAX_SCREEN_COLMaximum screen's columns.- See Also:
-
MAX_SCREEN_ROWS
public static final int MAX_SCREEN_ROWSMaximum screen's rows.- See Also:
-
SCALE
public static final int SCALEScale factor of the game.- See Also:
-
WIDTH_TILE_SIZE
public static final int WIDTH_TILE_SIZEWidth of scaled tile.- See Also:
-
SCREEN_WIDTH
public static final int SCREEN_WIDTHScreen width.- See Also:
-
CAMERA_MIN_RIGHT
public static final int CAMERA_MIN_RIGHTCamera's offset bound for right direction: when the player reaches the half of the screen it stops and the camera is updated.- See Also:
-
HEIGHT_TILE_SIZE
public static final int HEIGHT_TILE_SIZEHeight of scaled tile.- See Also:
-
SCREEN_HEIGHT
public static final int SCREEN_HEIGHTScreen height.- See Also:
-
PLAYER_MAX_HP
public static final int PLAYER_MAX_HPPlayer maximum health points.- See Also:
-
PLAYER_MAX_STAMINA
public static final int PLAYER_MAX_STAMINAPlayer maximum stamina.- See Also:
-
PLAYER_STAMINA_TIMER
public static final int PLAYER_STAMINA_TIMERStamina recovery timer.- See Also:
-
PLAYER_INVINCIBILITY_TIME
public static final int PLAYER_INVINCIBILITY_TIMEPlayer recovery timer, activated on hit.- See Also:
-
PRIMARY_COLOR
Primary color of the game's theme.- See Also:
-
SECONDARY_COLOR
Secondary color of the game's theme.- See Also:
-
CAMERA_MIN_LEFT
public static final int CAMERA_MIN_LEFTCamera's offset bound for left direction: when the player walks left the camera is updated before reaching the end of the screen.- See Also:
-
-
Constructor Details
-
Constants
public Constants()
-
-
Method Details
-
getOppositeDirection
Retrieves opposite direction of the provided one (e.g. LEFT parameter -> RIGHT returned value).
Used when retrieving the sprites for each entity since right sprites are obtained by translating left sprites.- Parameters:
direction- provided Direction.- Returns:
- opposite direction.
-