package com.juotos.prr;

import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input.Keys;
import com.badlogic.gdx.graphics.Camera;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.scenes.scene2d.ui.List;
import com.juotos.prr.Actors.Player;
import com.juotos.prr.Actors.Wall;

public class PRRGame extends ApplicationAdapter {
	SpriteBatch batch;
	Player player;
	Wall wall1, wall2;
	GameState state = GameState.RUN;
	
	OrthographicCamera camera;
	Rectangle rect;
	
	@Override
	public void create () {
		batch = new SpriteBatch();
		camera = new OrthographicCamera();
		player = new Player(this);
		wall1 = new Wall();
		wall2 = new Wall();
		initializeAssets();
		
		camera.setToOrtho(false, Constants.GAME_WIDTH, Constants.GAME_HEIGHT);
	}

	@Override
	public void render () {
		switch(state) {
			case RUN:
				renderRun();
				break;
			case PAUSE:
				renderPause();
				break;
			case RESUME:
				renderResume();
				break;
			case STOPPED:
				renderStopped();
				break;
		}
	}
	
	private void renderRun() {
		Gdx.gl.glClearColor(0.5f, 0.5f, 1, 1);	//red,green,blue,alpha
		Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); //Clear screen
		camera.update();
		anyKeyPressed();
		
		batch.setProjectionMatrix(camera.combined);
		
		batch.begin();
		batchUpdate();
		batch.end();
		
		player.update();
		
	}
	private void renderPause() {
		
	}
	private void renderResume() {
		
	}
	private void renderStopped() {
	
	}
	public void toggleGameState() {
		//Toggle pause or run state
		state = (state == GameState.RUN) ? GameState.PAUSE : GameState.RUN;
	}
	private void initializeAssets() {
	}
	
	private void anyKeyPressed() {
		if(Gdx.input.isKeyPressed(Keys.SPACE)) {
			Gdx.app.log("loglog", "space entered");
		}
	}
	private void batchUpdate() {
		batch.draw(player.currentPlayerTexture(), player.x, player.y);
		
	}

}

@@ -904,24 +904,28 @@
  = new Wall(
+0, 0
 );%0A%09%09wall2 =
@@ -938,30 +938,34 @@
 all(
-);%0A%09%09initializeAssets(
+Constants.GAME_WIDTH-70, 0
 );%0A%09
@@ -1856,46 +1856,8 @@
 %0A%09%7D%0A
-%09private void initializeAssets() %7B%0A%09%7D%0A
 %09%0A%09p
@@ -2015,73 +2015,75 @@
 %7B%0A%09%09
-batch.draw(player.currentPlayerTexture(), player.x, player.y);%0A%09%09
+player.render(batch);%0A%09%09wall1.render(batch);%0A%09%09wall2.render(batch);
 %0A%09%7D%0A

Update wall initialization