fix merge
BIN
assets/blank_die_faces_sheet.png
Normal file
After Width: | Height: | Size: 8.7 KiB |
BIN
assets/pip.png
Before Width: | Height: | Size: 855 B After Width: | Height: | Size: 860 B |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.4 KiB |
BIN
assets/shop_banner.png
Normal file
After Width: | Height: | Size: 7.3 KiB |
|
@ -19,9 +19,14 @@ public class Face extends Actor{
|
||||||
private static Texture blankFaceSprite;
|
private static Texture blankFaceSprite;
|
||||||
private static Texture pipSprite;
|
private static Texture pipSprite;
|
||||||
|
|
||||||
|
int faceNumber;
|
||||||
|
|
||||||
|
|
||||||
public Face(int pipCount, Transform transform) {
|
public Face(int pipCount, Transform transform) {
|
||||||
addPipsForValue(pipCount);
|
addPipsForValue(pipCount);
|
||||||
this.transform = transform;
|
this.transform = transform;
|
||||||
|
Random rand = new Random();
|
||||||
|
faceNumber = rand.nextInt(0, 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addPipsForValue(int value){
|
private void addPipsForValue(int value){
|
||||||
|
@ -106,7 +111,7 @@ public class Face extends Actor{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(SpriteBatch batch) {
|
public void render(SpriteBatch batch) {
|
||||||
Sprite face = new Sprite(blankFaceSprite);
|
Sprite face = new Sprite(blankFaceSprite, 64*faceNumber, 0, 64, 64);
|
||||||
face.setOrigin(face.getWidth()/2, face.getHeight()/2);
|
face.setOrigin(face.getWidth()/2, face.getHeight()/2);
|
||||||
face.rotate(transform.getRotation());
|
face.rotate(transform.getRotation());
|
||||||
face.setPosition(transform.x-face.getWidth()/2, transform.y-face.getHeight()/2);
|
face.setPosition(transform.x-face.getWidth()/2, transform.y-face.getHeight()/2);
|
||||||
|
|
|
@ -44,7 +44,8 @@ public class Game extends ApplicationAdapter {
|
||||||
|
|
||||||
ui = new UI(this, 50, 280);
|
ui = new UI(this, 50, 280);
|
||||||
|
|
||||||
Face.setBlankFaceSprite(new Texture("blank_die_face.png"));
|
Face.setBlankFaceSprite(new Texture("blank_die_faces_sheet.png"));
|
||||||
|
|
||||||
Face.setPipSprite(new Texture("pip.png"));
|
Face.setPipSprite(new Texture("pip.png"));
|
||||||
Die.setLockedSprite(new Texture("locked_die_border.png"));
|
Die.setLockedSprite(new Texture("locked_die_border.png"));
|
||||||
UI.setRerollTexture(new Texture("reroll_symbol.png"));
|
UI.setRerollTexture(new Texture("reroll_symbol.png"));
|
||||||
|
|