Commit 5ae29c12 authored by Nils Hein's avatar Nils Hein
Browse files

Timer wird durch füllen des nextButtons dargestellt

parent 27d20ab9
......@@ -9,6 +9,7 @@ import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector2;
......@@ -54,7 +55,7 @@ public class GameScreen implements Screen {
ShapeRenderer renderer = new ShapeRenderer();
float bound = 0;
Sprite bg, bgOverlay;
Sprite nextTop, nextBottom;
Sprite nextTop,nextTopOverlay, nextBottom, nextBottomOverlay;
Vector2 mapoffset;
private Rectangle m_Bounds;
float wWidth, wHeight;
......@@ -98,6 +99,20 @@ public class GameScreen implements Screen {
nextTop.rotate(180);
nextTop.setCenter(wWidth / 4.0f * 3.0f, wHeight * 0.95f);
nextBottom.setAlpha(0.1f);
nextTop.setAlpha(0.1f);
nextBottomOverlay = new Sprite(FrozenNumbersGame.assets.get("sprites/btn_next.png", Texture.class));
nextBottomOverlay.setScale(scaleX, scaleY);
nextBottomOverlay.setCenter(wWidth / 4.0f, wHeight * 0.05f);
nextTopOverlay = new Sprite(FrozenNumbersGame.assets.get("sprites/btn_next.png", Texture.class));
nextTopOverlay.setScale(scaleX, scaleY);
nextTopOverlay.rotate(180);
nextTopOverlay.setCenter(wWidth / 4.0f * 3.0f, wHeight * 0.95f);
hexbulder.setGridHeight(15);
hexbulder.setGridWidth(11);
hexbulder.setRadius(bubblradius);
......@@ -362,6 +377,18 @@ public class GameScreen implements Screen {
nextTop.draw(batch);
nextBottom.draw(batch);
nextTopOverlay.draw(batch);
nextBottomOverlay.draw(batch);
//Timer darstellung
float bW = (nextBottom.getWidth()-(nextBottom.getWidth()*(p1.timer/timerDefault)));
float tW = (nextTop.getWidth()-(nextTop.getWidth()*(p2.timer/timerDefault)));
nextBottomOverlay.setRegion(0,0,(int)bW,(int)nextBottom.getHeight());
nextBottomOverlay.setBounds(nextBottom.getX(),nextBottom.getY(),bW,nextBottom.getHeight());
nextTopOverlay.setRegion(0,0,(int)tW,(int)nextTop.getHeight());
nextTopOverlay.setBounds(nextTop.getX(),nextTop.getY(),tW,nextTop.getHeight());
if (p1.active != null) {
p1.active.draw(batch);
drawTextCentered(String.valueOf(p1.active.getValue()), p1.active.getPos().x, p1.active.getPos().y, p1.active.getColor());
......
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