Class App

java.lang.Object
com.badlogic.gdx.Game
fr.formiko.kokcinelo.App
All Implemented Interfaces:
com.badlogic.gdx.ApplicationListener

public class App extends com.badlogic.gdx.Game
Main class that represent the App & call other Screens. It call MainMenuScreen
Since:
0.1
Version:
2.4
See Also:
  • Game
  • Field Details

    • batch

      public com.badlogic.gdx.graphics.g2d.SpriteBatch batch
    • PLAYABLE_LEVELS

      public static final List<String> PLAYABLE_LEVELS
    • SUPPORTED_LANGUAGES

      public static List<String> SUPPORTED_LANGUAGES
    • LANGUAGES_NAMES

      public static Map<String,String> LANGUAGES_NAMES
    • LANGUAGES_PERCENTAGES

      public static Map<String,Integer> LANGUAGES_PERCENTAGES
    • STARS_SCORES

      public static final List<Integer> STARS_SCORES
    • BLUE_BACKGROUND

      public static final com.badlogic.gdx.graphics.Color BLUE_BACKGROUND
    • GREEN

      public static final com.badlogic.gdx.graphics.Color GREEN
    • SKY_BLUE_1

      public static final com.badlogic.gdx.graphics.Color SKY_BLUE_1
    • SKY_BLUE_2

      public static final com.badlogic.gdx.graphics.Color SKY_BLUE_2
  • Constructor Details

    • App

      public App(String[] args, Native nativ)
    • App

      public App()
  • Method Details

    • isWithCloseButton

      public static boolean isWithCloseButton()
    • setWithCloseButton

      public static void setWithCloseButton(boolean withCloseButton)
    • getDataMap

      public static Map<String,String> getDataMap()
    • getOptionsMap

      public static KOptionsMap getOptionsMap()
    • getLanguage

      public static String getLanguage()
    • saveSizeInOptions

      public static void saveSizeInOptions(int width, int height)
    • setLanguage

      public static void setLanguage(String language)
      Set language & update translation list.
      Parameters:
      language - language to switch to
    • create

      public void create()
      Main function call when App is created. It call MainMenuScreen.
      See Also:
      • ApplicationListener.create()
    • startNewGame

      public void startNewGame()
      Start a new Game on this app in GUI.
    • render

      public void render()
      call render function of sub screens
      Specified by:
      render in interface com.badlogic.gdx.ApplicationListener
      Overrides:
      render in class com.badlogic.gdx.Game
      See Also:
      • Game.render()
    • dispose

      public void dispose()
      call dispose function of item that need to be dispose so that App close itself.
      Specified by:
      dispose in interface com.badlogic.gdx.ApplicationListener
      Overrides:
      dispose in class com.badlogic.gdx.Game
      See Also:
      • Game.dispose()
    • exit

      public void exit(int code)
    • isPlayableLevel

      public static boolean isPlayableLevel(String levelId)
    • playSound

      public static void playSound(String fileName, float volume, float pan)
      Play the given sound. Sound can be play many times & at same time.
      Parameters:
      fileName - name of the sound file
      volume - volume of the sound in [0, 1]
      pan - left rigth ballance of the sound file in [-1, 1]
    • playSound

      public static void playSound(String fileName)
      Play the given sound with default volume & default pan. Sound can be play many times & at same time.
      Parameters:
      fileName - name of the sound file
    • playEndGameSound

      public void playEndGameSound(boolean haveWin)
      Play the end game sound. Sound can be play many times & at same time.
      Parameters:
      haveWin - the sound is different if game is win or lost
    • log

      public static void log(int logLevel, String tag, String message, Exception exception)
      Save or print log using Gdx.app settings.
      Parameters:
      logLevel - int value from 0 (debug) to 4 (error) to represent gravity of log
      tag - tag of the log
      message - message of the log
      exception - exception that have been catch
    • log

      public static void log(int logLevel, String tag, String message)
      Save or print log using Gdx.app settings.
      Parameters:
      logLevel - int value from 0 (debug) to 4 (error) to represent gravity of log
      tag - tag of the log
      message - message of the log
    • log

      public static void log(int logLevel, String message)
      Save or print log using Gdx.app settings.
      Parameters:
      logLevel - int value from 0 (debug) to 4 (error) to represent gravity of log
      message - message of the log
    • log

      public static void log(String message)
      Save or print log using Gdx.app settings.
      Parameters:
      message - message of the log
    • getCurrentTime

      public static String getCurrentTime()
      Return current time in standardized format.
      Returns:
      current time in standardized format
    • getCurrentVersion

      public static String getCurrentVersion()
      Return current version. If current version is unknown, return "...". Current version is unknown if version.md file haven't been save in .jar file.
      Returns:
      current version
    • getColorFromPercent

      public static com.badlogic.gdx.graphics.Color getColorFromPercent(int percent)
      Return color depending of percent.
      Parameters:
      percent - score percent [0;100+]
      Returns:
      color