Esempio n. 1
0
  public static void setDistance(float dist) {
    distTemp = score.getFloat("distance");
    distTemp = distTemp + dist;

    score.putFloat("distance", distTemp);
    score.flush();
  }
Esempio n. 2
0
 public void load() {
   sound = prefs.getBoolean("sound", true);
   music = prefs.getBoolean("music", true);
   // если нет записи в "volSound" берем значение 0.5 и проверяем на границы от 0.0 до 1.0
   volSound = MathUtils.clamp(prefs.getFloat("volSound", 0.5f), 0.0f, 1.0f);
   volMusic = MathUtils.clamp(prefs.getFloat("volMusic", 0.5f), 0.0f, 1.0f);
   charSkin = MathUtils.clamp(prefs.getInteger("charSkin", 0), 0, 2);
   showFpsCounter = prefs.getBoolean("showFpsCounter", false);
   useMonochromeShader = prefs.getBoolean("useMonochromeShader", false);
 }
Esempio n. 3
0
  private void initMusic() {
    music = AssetsLoader.getMusic();

    boolean musicOn = preferences.getBoolean("musicOn", true);
    float musicVolume = preferences.getFloat("musicVolume", 1);
    music.setLooping(true);
    if (musicOn) {
      music.play();
    }
    music.setVolume(musicVolume);
  }
Esempio n. 4
0
 public static float getLuck() {
   check();
   return prefs.getFloat(Consts.PREF_LUCK, Consts.DEFAULT_LUCK);
 }
Esempio n. 5
0
 public static float getScoreTimer() {
   check();
   return prefs.getFloat(Consts.PREF_SCORE_TIMER, Consts.DEFAULT_TIMER);
 }
Esempio n. 6
0
 public static float getUpgradeCost() {
   check();
   return prefs.getFloat(Consts.PREF_UPGRADE_COST, Consts.DEFAULT_UPGRADE_COST);
 }
Esempio n. 7
0
 public static float getHighScore() {
   return score.getFloat("highScore");
 }
Esempio n. 8
0
 public static float getDistance() {
   return score.getFloat("distance");
 }
Esempio n. 9
0
 public static float getHighScore() {
   return options.getFloat("highscore", 0);
 }