Merge branch 'main' of github.com:Wil-Ro/gamejam2024
This commit is contained in:
commit
37ec466241
6 changed files with 65 additions and 1 deletions
Binary file not shown.
BIN
assets/shope.png
Normal file
BIN
assets/shope.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
BIN
assets/shope_die_border.png
Normal file
BIN
assets/shope_die_border.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.1 KiB |
|
@ -17,10 +17,16 @@ public class Face extends Actor{
|
|||
private final List<Pip> 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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
46
core/src/com/monjaro/gamejam/main/ShopeUi.java
Normal file
46
core/src/com/monjaro/gamejam/main/ShopeUi.java
Normal file
|
@ -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<Face> 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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue