Package fr.formiko.kokcinelo
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 Summary
FieldsModifier and TypeFieldDescriptioncom.badlogic.gdx.graphics.g2d.SpriteBatch
static final com.badlogic.gdx.graphics.Color
static final com.badlogic.gdx.graphics.Color
static final com.badlogic.gdx.graphics.Color
static final com.badlogic.gdx.graphics.Color
Fields inherited from class com.badlogic.gdx.Game
screen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
create()
Main function call when App is created.void
dispose()
call dispose function of item that need to be dispose so that App close itself.void
exit
(int code) static com.badlogic.gdx.graphics.Color
getColorFromPercent
(int percent) Return color depending of percent.static String
Return current time in standardized format.static String
Return current version.static String
static KOptionsMap
static boolean
isPlayableLevel
(String levelId) static boolean
static void
Save or print log using Gdx.app settings.static void
Save or print log using Gdx.app settings.static void
Save or print log using Gdx.app settings.static void
Save or print log using Gdx.app settings.void
playEndGameSound
(boolean haveWin) Play the end game sound.static void
Play the given sound with default volume & default pan.static void
Play the given sound.void
render()
call render function of sub screensstatic void
saveSizeInOptions
(int width, int height) static void
setLanguage
(String language) Set language & update translation list.static void
setWithCloseButton
(boolean withCloseButton) void
Start a new Game on this app in GUI.Methods inherited from class com.badlogic.gdx.Game
getScreen, pause, resize, resume, setScreen
-
Field Details
-
batch
public com.badlogic.gdx.graphics.g2d.SpriteBatch batch -
PLAYABLE_LEVELS
-
SUPPORTED_LANGUAGES
-
LANGUAGES_NAMES
-
LANGUAGES_PERCENTAGES
-
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
-
App
public App()
-
-
Method Details
-
isWithCloseButton
public static boolean isWithCloseButton() -
setWithCloseButton
public static void setWithCloseButton(boolean withCloseButton) -
getDataMap
-
getOptionsMap
-
getLanguage
-
saveSizeInOptions
public static void saveSizeInOptions(int width, int height) -
setLanguage
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 interfacecom.badlogic.gdx.ApplicationListener
- Overrides:
render
in classcom.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 interfacecom.badlogic.gdx.ApplicationListener
- Overrides:
dispose
in classcom.badlogic.gdx.Game
- See Also:
-
Game.dispose()
-
exit
public void exit(int code) -
isPlayableLevel
-
playSound
Play the given sound. Sound can be play many times & at same time.- Parameters:
fileName
- name of the sound filevolume
- volume of the sound in [0, 1]pan
- left rigth ballance of the sound file in [-1, 1]
-
playSound
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
Save or print log using Gdx.app settings.- Parameters:
logLevel
- int value from 0 (debug) to 4 (error) to represent gravity of logtag
- tag of the logmessage
- message of the logexception
- exception that have been catch
-
log
Save or print log using Gdx.app settings.- Parameters:
logLevel
- int value from 0 (debug) to 4 (error) to represent gravity of logtag
- tag of the logmessage
- message of the log
-
log
Save or print log using Gdx.app settings.- Parameters:
logLevel
- int value from 0 (debug) to 4 (error) to represent gravity of logmessage
- message of the log
-
log
Save or print log using Gdx.app settings.- Parameters:
message
- message of the log
-
getCurrentTime
Return current time in standardized format.- Returns:
- current time in standardized format
-
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
-