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

    score.putFloat("distance", distTemp);
    score.flush();
  }
Beispiel #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);
 }
Beispiel #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);
  }
Beispiel #4
0
 public static float getLuck() {
   check();
   return prefs.getFloat(Consts.PREF_LUCK, Consts.DEFAULT_LUCK);
 }
Beispiel #5
0
 public static float getScoreTimer() {
   check();
   return prefs.getFloat(Consts.PREF_SCORE_TIMER, Consts.DEFAULT_TIMER);
 }
Beispiel #6
0
 public static float getUpgradeCost() {
   check();
   return prefs.getFloat(Consts.PREF_UPGRADE_COST, Consts.DEFAULT_UPGRADE_COST);
 }
 public static float getHighScore() {
   return score.getFloat("highScore");
 }
 public static float getDistance() {
   return score.getFloat("distance");
 }
 public static float getHighScore() {
   return options.getFloat("highscore", 0);
 }