Class Constants

java.lang.Object
fr.paris.saclay.sidescroller.utils.Constants

public class Constants extends Object
Utils class used to store common methods and variables.
  • Field Details

    • ORIGINAL_SQUARE_TILE

      public static final int ORIGINAL_SQUARE_TILE
      Single square size.
      See Also:
    • MAX_SCREEN_COL

      public static final int MAX_SCREEN_COL
      Maximum screen's columns.
      See Also:
    • MAX_SCREEN_ROWS

      public static final int MAX_SCREEN_ROWS
      Maximum screen's rows.
      See Also:
    • SCALE

      public static final int SCALE
      Scale factor of the game.
      See Also:
    • WIDTH_TILE_SIZE

      public static final int WIDTH_TILE_SIZE
      Width of scaled tile.
      See Also:
    • SCREEN_WIDTH

      public static final int SCREEN_WIDTH
      Screen width.
      See Also:
    • CAMERA_MIN_RIGHT

      public static final int CAMERA_MIN_RIGHT
      Camera'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_SIZE
      Height of scaled tile.
      See Also:
    • SCREEN_HEIGHT

      public static final int SCREEN_HEIGHT
      Screen height.
      See Also:
    • PLAYER_MAX_HP

      public static final int PLAYER_MAX_HP
      Player maximum health points.
      See Also:
    • PLAYER_MAX_STAMINA

      public static final int PLAYER_MAX_STAMINA
      Player maximum stamina.
      See Also:
    • PLAYER_STAMINA_TIMER

      public static final int PLAYER_STAMINA_TIMER
      Stamina recovery timer.
      See Also:
    • PLAYER_INVINCIBILITY_TIME

      public static final int PLAYER_INVINCIBILITY_TIME
      Player recovery timer, activated on hit.
      See Also:
    • PRIMARY_COLOR

      public static final String PRIMARY_COLOR
      Primary color of the game's theme.
      See Also:
    • SECONDARY_COLOR

      public static final String SECONDARY_COLOR
      Secondary color of the game's theme.
      See Also:
    • CAMERA_MIN_LEFT

      public static final int CAMERA_MIN_LEFT
      Camera'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

      public static Direction getOppositeDirection(Direction direction)
      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.