textures
This commit is contained in:
parent
7632c476fa
commit
b212f1884d
10 changed files with 7 additions and 2 deletions
|
@ -19,9 +19,14 @@ public class Face extends Actor{
|
|||
private static Texture blankFaceSprite;
|
||||
private static Texture pipSprite;
|
||||
|
||||
int faceNumber;
|
||||
|
||||
|
||||
public Face(int pipCount, Transform transform) {
|
||||
addPipsForValue(pipCount);
|
||||
this.transform = transform;
|
||||
Random rand = new Random();
|
||||
faceNumber = rand.nextInt(0, 5);
|
||||
}
|
||||
|
||||
private void addPipsForValue(int value){
|
||||
|
@ -106,7 +111,7 @@ public class Face extends Actor{
|
|||
|
||||
@Override
|
||||
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.rotate(transform.getRotation());
|
||||
face.setPosition(transform.x-face.getWidth()/2, transform.y-face.getHeight()/2);
|
||||
|
|
|
@ -47,7 +47,7 @@ public class Game extends ApplicationAdapter {
|
|||
reroll();
|
||||
nextRound();
|
||||
|
||||
Face.setBlankFaceSprite(new Texture("blank_die_face.png"));
|
||||
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"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue