Commit ba08d3b2 authored by Bastian's avatar Bastian
Browse files

Temp GameOverScreen using new Look

parent fe13df93
......@@ -38,17 +38,16 @@ public class GameOverScreen implements Screen {
game = FrozenNumbersGame.game;
m_Screens = FrozenNumbersGame.m_Screens;
//generating backround
bg = new Sprite(FrozenNumbersGame.assets.get("border.png", Texture.class));
bg = new Sprite(FrozenNumbersGame.assets.get("backgrounds/main-screen.png", Texture.class));
bg.setSize(wWidth, wHeight);
bg.setCenter(wWidth / 2.0f, wHeight / 2.0f);
bg.setColor(Color.LIGHT_GRAY);
//generating Close button#
close = new Sprite(FrozenNumbersGame.assets.get("tut_close.png", Texture.class));
close = new Sprite(FrozenNumbersGame.assets.get("sprites/btn_back.png", Texture.class));
close.setOriginCenter();
close.setPosition(wWidth / 2.0f - close.getWidth() / 2, 0.5f * wHeight - close.getHeight() / 2);
close.getBoundingRectangle();
}
@Override
......@@ -78,27 +77,36 @@ public class GameOverScreen implements Screen {
Gdx.gl.glClearColor(1, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
FrozenNumbersGame.batch.begin();
bg.draw(FrozenNumbersGame.batch);
FrozenNumbersGame.batch.end();
FrozenNumbersGame.shapeRenderer.begin(ShapeType.Filled);
Gdx.gl.glEnable(GL20.GL_BLEND);
Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
String p1String = "";
String p2String = "";
if(p1 > p2)
{
FrozenNumbersGame.shapeRenderer.setColor(0f,1f,0f,1f);
FrozenNumbersGame.shapeRenderer.setColor(0f,1f,0f,.1f);
FrozenNumbersGame.shapeRenderer.rect(0,(float) (wHeight/2.0),wWidth,(float) (-wHeight/2.0));
FrozenNumbersGame.shapeRenderer.setColor(1f,0f,0f,.1f);
FrozenNumbersGame.shapeRenderer.rect(0,(float) (wHeight/2.0),wWidth,(float) (wHeight/2.0));
p1String = "WIN";
p2String = "LOSE";
}
if(p2 > p1)
{
FrozenNumbersGame.shapeRenderer.setColor(0f,1f,1f,1f);
FrozenNumbersGame.shapeRenderer.setColor(1f,0f,0f,.1f);
FrozenNumbersGame.shapeRenderer.rect(0,(float) (wHeight/2.0),wWidth,(float) (-wHeight/2.0));
FrozenNumbersGame.shapeRenderer.setColor(0f,1f,0f,.1f);
FrozenNumbersGame.shapeRenderer.rect(0,(float) (wHeight/2.0),wWidth,(float) (wHeight/2.0));
p1String = "LOSE";
p2String = "WIN";
}
if(p2 == p1)
{
FrozenNumbersGame.shapeRenderer.setColor(.5f,.5f,0f,1f);
FrozenNumbersGame.shapeRenderer.setColor(.5f,.5f,0f,.1f);
FrozenNumbersGame.shapeRenderer.rect(0,0,wWidth,wHeight);
p1String = "DRAW";
p2String = "DRAW";
......@@ -107,7 +115,6 @@ public class GameOverScreen implements Screen {
FrozenNumbersGame.shapeRenderer.end();
FrozenNumbersGame.batch.begin();
GlyphLayout glyphLayout = new GlyphLayout();
float w = 0;
glyphLayout.setText(FrozenNumbersGame.assets.get("size20.ttf", BitmapFont.class),String.valueOf(p1));
......@@ -134,7 +141,7 @@ public class GameOverScreen implements Screen {
container.setPosition((float) (wWidth / 2.0), (float) (wHeight / 2.0 + (wHeight/4.0)));
container.draw(FrozenNumbersGame.batch, 1);
bg.draw(FrozenNumbersGame.batch);
close.draw(FrozenNumbersGame.batch);
FrozenNumbersGame.batch.end();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment