Android Open Source - FloppyThreeD Settings Manager






From Project

Back to project page FloppyThreeD.

License

The source code is released under:

MIT License

If you think the Android project FloppyThreeD listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.jtechapps.FloppyThreeD;
/*w  w w .  j av  a 2s  . c om*/
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Preferences;

public class SettingsManager {
  private boolean quickreset;
  private int difficulty = 1;//0 is noob; 1 is easy; 2 is medium; 3 is hard; 4 is pro
  
  public void togglequickreset(){
    quickreset ^= true;
    Preferences prefs = Gdx.app.getPreferences("FloppyThreeD");
    prefs.putBoolean("quickreset", quickreset);
    prefs.flush();
  }
  
  public boolean getquickreset(){
    Preferences prefs = Gdx.app.getPreferences("FloppyThreeD");
    return prefs.getBoolean("quickreset", quickreset);
  }
  
  public void toggledifficulty(){
    difficulty++;
    if(difficulty>4){
      difficulty = 0;
    }
    Preferences prefs = Gdx.app.getPreferences("FloppyThreeD");
    prefs.putInteger("difficulty", difficulty);
    prefs.flush();
  }
  
  /**
   * 0 is noob; 1 is easy; 2 is medium; 3 is hard; 4 is pro
   * @return
   */
  public int getdifficulty(){
    Preferences prefs = Gdx.app.getPreferences("FloppyThreeD");
    return prefs.getInteger("difficulty", difficulty);
  }
}




Java Source Code List

com.jtechapps.FloppyThreeD.FloppyGame.java
com.jtechapps.FloppyThreeD.IOSInterface.java
com.jtechapps.FloppyThreeD.IOSLauncher.java
com.jtechapps.FloppyThreeD.NativeInterface.java
com.jtechapps.FloppyThreeD.ScoreManager.java
com.jtechapps.FloppyThreeD.SettingsManager.java
com.jtechapps.FloppyThreeD.Screens.AboutScreen.java
com.jtechapps.FloppyThreeD.Screens.ClassicGameScreen.java
com.jtechapps.FloppyThreeD.Screens.FirstPersonScreen.java
com.jtechapps.FloppyThreeD.Screens.MainMenuScreen.java
com.jtechapps.FloppyThreeD.Screens.SettingsScreen.java
com.jtechapps.FloppyThreeD.android.AndroidInterface.java
com.jtechapps.FloppyThreeD.android.AndroidLauncher.java
com.jtechapps.FloppyThreeD.client.HtmlInterface.java
com.jtechapps.FloppyThreeD.client.HtmlLauncher.java
com.jtechapps.FloppyThreeD.desktop.DesktopAdapter.java
com.jtechapps.FloppyThreeD.desktop.DesktopInterface.java
com.jtechapps.FloppyThreeD.desktop.DesktopLauncher.java