diff --git a/assets/raw_assets/locked_die_border.kra b/assets/raw_assets/locked_die_border.kra index 1333249..2e99c54 100644 Binary files a/assets/raw_assets/locked_die_border.kra and b/assets/raw_assets/locked_die_border.kra differ diff --git a/assets/shope.png b/assets/shope.png new file mode 100644 index 0000000..a35a363 Binary files /dev/null and b/assets/shope.png differ diff --git a/assets/shope_die_border.png b/assets/shope_die_border.png new file mode 100644 index 0000000..b67917b Binary files /dev/null and b/assets/shope_die_border.png differ diff --git a/core/src/com/monjaro/gamejam/main/Face.java b/core/src/com/monjaro/gamejam/main/Face.java index 1aec021..1013b88 100644 --- a/core/src/com/monjaro/gamejam/main/Face.java +++ b/core/src/com/monjaro/gamejam/main/Face.java @@ -17,10 +17,16 @@ public class Face extends Actor{ private final List pips = new ArrayList<>(); private static Texture blankFaceSprite; + private static Texture pipSprite; int faceNumber; + public Face(int pipCount) { + addPipsForValue(pipCount); + Random rand = new Random(); + faceNumber = rand.nextInt(0, 5); + } public Face(int pipCount, Transform transform) { addPipsForValue(pipCount); @@ -97,6 +103,10 @@ public class Face extends Actor{ pipSprite = sprite; } + public Transform getTransform() { + return transform; + } + public Vector2 calculatePipLocation(Vector2 percentages) { double radians = Math.toRadians(transform.rotation); diff --git a/core/src/com/monjaro/gamejam/main/Game.java b/core/src/com/monjaro/gamejam/main/Game.java index 2d51b60..afdd364 100644 --- a/core/src/com/monjaro/gamejam/main/Game.java +++ b/core/src/com/monjaro/gamejam/main/Game.java @@ -31,6 +31,7 @@ public class Game extends ApplicationAdapter { private UI ui; private SegmentUI segUi; + private ShopeUi shopeUi; @Override public void create() { @@ -42,12 +43,17 @@ public class Game extends ApplicationAdapter { ui = new UI(this, 50, 280); + shopeUi = new ShopeUi(); + ShopeUi.setGame(this); + Face.setBlankFaceSprite(new Texture("blank_die_faces_sheet.png")); Face.setPipSprite(new Texture("pip.png")); Die.setLockedSprite(new Texture("locked_die_border.png")); UI.setRerollTexture(new Texture("reroll_symbol.png")); SegmentUI.setCriteriaSheet(new Texture("criteria.png")); + ShopeUi.setBacking(new Texture("shope.png")); + ShopeUi.setFaceBacking(new Texture("shope_die_border.png")); // SegmentUI.setCriteriaSheet(""); not made yet // setting up font @@ -158,6 +164,8 @@ public class Game extends ApplicationAdapter { segUi.render(batch); + shopeUi.render(batch); + batch.end(); } @@ -223,7 +231,7 @@ public class Game extends ApplicationAdapter { int x = 64, y = 64; while (shope.size() < 3) { - Face ware = new Face(1 + random.nextInt(6), new Transform(x += 96, y, 64, 64));//TODO RO FIX plz i beg!!!! + Face ware = new Face(1 + random.nextInt(6));//TODO RO FIX plz i beg!!!! shope.add(ware); } } diff --git a/core/src/com/monjaro/gamejam/main/ShopeUi.java b/core/src/com/monjaro/gamejam/main/ShopeUi.java new file mode 100644 index 0000000..d7d5a29 --- /dev/null +++ b/core/src/com/monjaro/gamejam/main/ShopeUi.java @@ -0,0 +1,46 @@ +package com.monjaro.gamejam.main; + +import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; + +import java.util.List; + +public class ShopeUi extends Actor{ + + private static Texture backing; + private static Texture faceBacking; + + public static void setFaceBacking(Texture faceBacking) { + ShopeUi.faceBacking = faceBacking; + } + + private static Game game; + + public static void setGame(Game game) { + ShopeUi.game = game; + } + + public static void setBacking(Texture backing) { + ShopeUi.backing = backing; + } + + @Override + public void tick() { + + } + + @Override + public void render(SpriteBatch batch) { + batch.draw(backing, 0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()/4); + List shope = game.getShope(); + for (int i = 0; i < shope.size(); i++) { + Face face = shope.get(i); + face.setTransform(new Transform(((Gdx.graphics.getWidth()/4)*i)+(Gdx.graphics.getWidth()/4), Gdx.graphics.getHeight()/8, 64, 64)); + + face.render(batch); + batch.draw(faceBacking, face.getTransform().x-faceBacking.getWidth()/2, face.getTransform().y-faceBacking.getHeight()/2); + } + + } +}