package com.lubjam16.epiceggsmash;

import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.lubjam16.epiceggsmash.credits.CreditsScreen;
import com.lubjam16.epiceggsmash.game.Animations;
import com.lubjam16.epiceggsmash.game.GameScreen;
import com.lubjam16.epiceggsmash.game.Graphics;
import com.lubjam16.epiceggsmash.game.Particles;
import com.lubjam16.epiceggsmash.game.Sounds;
import com.lubjam16.epiceggsmash.global.Fonts;
import com.lubjam16.epiceggsmash.mainMenu.MainMenuScreen;
import com.lubjam16.epiceggsmash.rules.RulesScreen;

public class EpicEggSmash extends Game {

    MainMenuScreen mainMenuScreen;
    RulesScreen rulesScreen;
    CreditsScreen creditsScreen;
    GameScreen gameScreen;

	@Override
	public void create () {
		Fonts.init();
        Graphics.init();
        Animations.init();
        Sounds.init();
        Particles.init();
        mainMenuScreen = new MainMenuScreen(this);
        rulesScreen = new RulesScreen(this);
        creditsScreen = new CreditsScreen(this);
        gameScreen = new GameScreen(this);
        setScreen(mainMenuScreen);
	}

    public void goToMainMenu(){
        setScreen(mainMenuScreen);
    }

    public void goToRules(){
        setScreen(rulesScreen);
    }

    public void goToCredits(){
        setScreen(creditsScreen);
    }

    public void goToGame(int selectedEggs){
        gameScreen.init(selectedEggs);
        setScreen(gameScreen);
    }

    public void quit(){
        Gdx.app.exit();
    }

	@Override
	public void dispose () {
        mainMenuScreen.dispose();
        rulesScreen.dispose();
        creditsScreen.dispose();
        gameScreen.dispose();
        Fonts.clear();
        Animations.clear();
        Sounds.clear();
        Particles.clear();;
	}
}
