package de.samdev.colorrunner;

import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Preferences;
import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.audio.Music;

import de.samdev.colorrunner.screens.menu.impl.SplashScreen;

public class CRGame extends Game {
	public final static boolean DEBUG = true;
	public static AssetManager manager;


	@Override
	public void create() {
		//if (DEBUG)
		//	setScreen(new GameScreen());
		//else

		manager = new AssetManager();
		manager.load("sound/mainsound.mp3", Music.class);
		//manager.load("sound/menusound.mp3", Music.class);
		manager.finishLoading();

		Preferences endlessGameInfos = Gdx.app.getPreferences("endlessGameInfos");
		endlessGameInfos.putInteger("lastBest", 0);
		endlessGameInfos.flush();

		setScreen(new SplashScreen());
	}

	public static CRGame Inst() {
		return ((CRGame) Gdx.app.getApplicationListener());
	}
}
