package uk.co.beercave.gunboat.screens;

import uk.co.beercave.gunboat.ControlSystems;
import uk.co.beercave.gunboat.GunBoat;
import uk.co.beercave.gunboat.GunBoat.ScreenType;
import uk.co.beercave.gunboat.entities.GameWorld;
import uk.co.beercave.gunboat.renderers.FaderRenderer;
import uk.co.beercave.gunboat.renderers.GuiRenderer;
import uk.co.beercave.gunboat.renderers.SeaRenderer;
import uk.co.beercave.gunboat.renderers.SkyRenderer;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;

public class GameScreen extends abstractScreen{

	private GunBoat parent;

	public GameScreen(GunBoat parent) {
		this.parent = parent;
	}

	@Override
	public void onRender(float delta) {
		
		GameWorld.update(delta);
		GuiRenderer.update();
		
		SkyRenderer.render(delta);
		SeaRenderer.render(delta);
		
		if (GameWorld.ended) parent.switchScreen(ScreenType.TITLE);
		
	}

	@Override
	public void resize(int width, int height) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void show() {
		Gdx.app.log("", "Entering GAME screen");
		FaderRenderer.fadeIn(2);
		GameWorld.reset();
	}

	@Override
	public void hide() {
		
	}

	@Override
	public void pause() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void resume() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void dispose() {
		// TODO Auto-generated method stub
		
	}

}
