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 int
Camera's offset bound for left direction: when the player walks left the camera is updated before reaching the end of the screen.static final int
Camera's offset bound for right direction: when the player reaches the half of the screen it stops and the camera is updated.static final int
Height of scaled tile.static final int
Maximum screen's columns.static final int
Maximum screen's rows.static final int
Single square size.static final int
Player recovery timer, activated on hit.static final int
Player maximum health points.static final int
Player maximum stamina.static final int
Stamina recovery timer.static final String
Primary color of the game's theme.static final int
Scale factor of the game.static final int
Screen height.static final int
Screen width.static final String
Secondary color of the game's theme.static final int
Width of scaled tile. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Direction
getOppositeDirection
(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.
-