package com.mygdx.game;

import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;

import menus.Battle;
import menus.Menu;
import menus.MenuInicio;
import menus.MenuOpcions;
import menus.MenuSeleccion;
import utilidades.Gifs;

public class MyGdxGame extends ApplicationAdapter {
	SpriteBatch batch;
	BitmapFont font;
	int WIN_ALT;
	int WIN_ANCH;
	float contadorGif = 0;
	Gifs pinchos;
	int menuSeleccionado=0;
	@Override
	public void create () {
		batch = new SpriteBatch();
		font = new BitmapFont(Gdx.files.internal("CentieSans.fnt"));
		WIN_ALT=900;
		WIN_ANCH=700;
		Gdx.graphics.setWindowedMode(WIN_ALT, WIN_ANCH);
		Menu.menus.add(new MenuInicio());
		Menu.menus.add(new MenuOpcions());
		Menu.menus.add(new MenuSeleccion());
	}

	@Override
	public void render () {
		Gdx.gl.glClearColor(0.5f, 0, 0, 1);
		Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
		batch.begin();
		float delta = Gdx.graphics.getDeltaTime();
		this.menuSeleccionado=Menu.menus.get(this.menuSeleccionado).draw(batch, delta);
		batch.end();
	}
	
	@Override
	public void dispose () {
		batch.dispose();
		font.dispose();
		Menu.menus.get(this.menuSeleccionado).dispose();
	}
}
