package com.palepail.TestGame.Screens;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.palepail.TestGame.TestGame;
import com.palepail.TestGame.Levels.Level;
import com.palepail.TestGame.Levels.LevelOne;
import com.palepail.TestGame.Levels.TestLevel;
import com.palepail.TestGame.View.World;
import com.palepail.TestGame.View.WorldRender;
public class GameScreen implements Screen {
TestGame game;
World world;
WorldRender render;
Level level;
float time =0;
public GameScreen (TestGame game){
this(game, new LevelOne());
// this(game, new TestLevel());
}
public GameScreen (TestGame game, Level level){
this.game = game;
this.level = level;
world = new World(game, this.level);
render = new WorldRender(world);
}
@Override
public void render(float delta) {
time+=Gdx.graphics.getDeltaTime();
if ( time >= (1 / 30)) {
time=0;
render.render();
world.update();
}
}
@Override
public void resize(int width, int height) {
// TODO Auto-generated method stub
}
@Override
public void show() {
// TODO Auto-generated method stub
}
@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() {
world.dispose();
render.dispose();
}
}