Commit ba926490 authored by Fjen Undso's avatar Fjen Undso
Browse files

use new background. but doesnt load

parent 67e09c44
......@@ -66,19 +66,20 @@ public class FrozenNumbersGame extends ApplicationAdapter {
size3Params.fontParameters.size = 40;
assets.load("size40.ttf", BitmapFont.class, size3Params);
assets.load("backgrounds/background.jpg", Texture.class);
// menu
assets.load("backgrounds/main-screen.png", Texture.class);
assets.load("sprites/btn_help.png", Texture.class);
assets.load("sprites/btn_ready_active.png", Texture.class);
assets.load("sprites/btn_ready_inactive.png", Texture.class);
// tutorial
assets.load("backgrounds/tutorial-screen.png", Texture.class);
assets.load("sprites/tutorial.png", Texture.class);
assets.load("sprites/btn_back.png", Texture.class);
// game
assets.load("backgrounds/game-screen.png", Texture.class);
assets.load("sprites/game-border.png", Texture.class);
assets.load("sprites/bubble.png", Texture.class);
assets.load("sprites/btn_next.png", Texture.class);
// sounds
assets.load("snd/hit.mp3", Sound.class);
......
......@@ -39,7 +39,7 @@ public class GameOverScreen implements Screen {
m_Screens = FrozenNumbersGame.m_Screens;
//generating backround
bg = new Sprite(FrozenNumbersGame.assets.get("backgrounds/main-screen.png", Texture.class));
bg = new Sprite(FrozenNumbersGame.assets.get("backgrounds/background.jpg", Texture.class));
float scaleX = wWidth / bg.getWidth();
float scaleY = wHeight / bg.getHeight();
bg.setScale(scaleX, scaleY);
......
......@@ -72,8 +72,10 @@ public class GameScreen implements Screen {
m_Bounds = new Rectangle(0, bubblradius, (float) wWidth, (float) wHeight - bubblradius);
bg = new Sprite(FrozenNumbersGame.assets.get("backgrounds/game-screen.png", Texture.class));
bg.setSize(wWidth, wHeight);
bg = new Sprite(FrozenNumbersGame.assets.get("backgrounds/background.jpg", Texture.class));
float scaleX = wWidth / bg.getWidth();
float scaleY = wHeight / bg.getHeight();
bg.setScale(scaleX, scaleY);
bg.setCenter(wWidth / 2.0f, wHeight / 2.0f);
hexbulder.setGridHeight(15);
......@@ -87,9 +89,8 @@ public class GameScreen implements Screen {
mapoffset = new Vector2(0, (wHeight / 2.0f) - (float) test.getCenterY());
bound = wHeight / 2f;//float) map.getByGridCoordinate(0, 6 ).getCenterY();
p1.sPos = new Vector2(new Vector2(wWidth / 2.0f, bubblradius + 5));
p2.sPos = new Vector2(new Vector2(wWidth / 2.0f, wHeight - (bubblradius + 5)));
p1.sPos = new Vector2(wWidth / 2.0f, 100 * scaleY);
p2.sPos = new Vector2(wWidth / 2.0f, wHeight - 100 * scaleY);
}
@Override
......@@ -108,9 +109,9 @@ public class GameScreen implements Screen {
private void playerlogic(Player p, boolean lower) {
if (p.active == null) {
p.active = new Bubble(p.sPos.cpy().add(-100, 0));
p.active = new Bubble(p.sPos.cpy());
p.active.setSize(bubblradius * 2, bubblradius * 2);
p.active.setPos(p.sPos.cpy());
p.active.setCenter(p.sPos.x, p.sPos.y);
System.out.println(p.active.getPos());
}
......@@ -305,7 +306,6 @@ public class GameScreen implements Screen {
}
private void drawTextCentered(String text, float x, float y, Color c) {
Actor rotaater;
Label myLabel = new Label(text, new Label.LabelStyle(FrozenNumbersGame.assets.get("size40.ttf", BitmapFont.class), c));
Label myLabel2 = new Label(text, new Label.LabelStyle(FrozenNumbersGame.assets.get("size40.ttf", BitmapFont.class), c));
......
......@@ -7,8 +7,11 @@ import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
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.math.Vector2;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.scenes.scene2d.ui.Table;
import org.milderjoghurt.frozennumbers.FrozenNumbersGame;
......@@ -30,7 +33,7 @@ public class MainMenuScreen implements Screen {
wHeight = FrozenNumbersGame.viewport.getWorldHeight();
//generating backround
bg = new Sprite(FrozenNumbersGame.assets.get("backgrounds/main-screen.png", Texture.class));
bg = new Sprite(FrozenNumbersGame.assets.get("backgrounds/background.jpg", Texture.class));
float scaleX = wWidth / bg.getWidth();
float scaleY = wHeight / bg.getHeight();
bg.setScale(scaleX, scaleY);
......@@ -49,11 +52,11 @@ public class MainMenuScreen implements Screen {
//generating QuestionmarkButtons
p1_quest = new Sprite(FrozenNumbersGame.assets.get("sprites/btn_help.png", Texture.class));
p1_quest.setScale(scaleX, scaleY);
p1_quest.setCenter(wWidth / 2.0f, wHeight / 4.0f - p1_quest.getHeight());
p1_quest.setCenter(wWidth / 2.0f, wHeight / 4.0f - p1_quest.getHeight() * scaleY);
p2_quest = new Sprite(FrozenNumbersGame.assets.get("sprites/btn_help.png", Texture.class));
p2_quest.setScale(scaleX, scaleY);
p2_quest.setCenter(wWidth / 2.0f, wHeight / 4.0f * 3.0f + p2_quest.getHeight());
p2_quest.setCenter(wWidth / 2.0f, wHeight / 4.0f * 3.0f + p2_quest.getHeight() * scaleY);
p2_quest.rotate(180);
p1_isready = false;
......@@ -113,6 +116,15 @@ public class MainMenuScreen implements Screen {
p1_quest.draw(batch);
p2_quest.draw(batch);
Label p2TextLabel = new Label("Frozen Numbers", new Label.LabelStyle(FrozenNumbersGame.assets.get("size40.ttf", BitmapFont.class), Color.WHITE));
Table container = new Table();
container.setTransform(true);
container.add(p2TextLabel);
container.setRotation(180);
container.setPosition((float) (wWidth / 2.0), (float) (wHeight / 2.0 + 60));
container.draw(batch, 1);
batch.end();
//Starting game if ready
......
......@@ -28,7 +28,7 @@ public class TutorialScreen implements Screen {
wHeight = FrozenNumbersGame.viewport.getWorldHeight();
//generating backround
bg = new Sprite(FrozenNumbersGame.assets.get("backgrounds/tutorial-screen.png", Texture.class));
bg = new Sprite(FrozenNumbersGame.assets.get("backgrounds/background.jpg", Texture.class));
float scaleX = wWidth / bg.getWidth();
float scaleY = wHeight / bg.getHeight();
bg.setScale(scaleX, scaleY);
......
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