adds variation to die faces
This commit is contained in:
parent
65377d8384
commit
a428fc7a87
1 changed files with 5 additions and 1 deletions
|
@ -8,6 +8,7 @@ import com.badlogic.gdx.math.Vector2;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
|
||||||
public class Face extends Actor{
|
public class Face extends Actor{
|
||||||
|
@ -19,6 +20,7 @@ public class Face extends Actor{
|
||||||
private static Texture blankFaceSprite;
|
private static Texture blankFaceSprite;
|
||||||
private static Texture pipSprite;
|
private static Texture pipSprite;
|
||||||
|
|
||||||
|
|
||||||
public Face(int pipCount) {
|
public Face(int pipCount) {
|
||||||
addPipsForValue(pipCount);
|
addPipsForValue(pipCount);
|
||||||
}
|
}
|
||||||
|
@ -53,7 +55,9 @@ public class Face extends Actor{
|
||||||
private final Vector2 location;
|
private final Vector2 location;
|
||||||
|
|
||||||
public Pip(float x, float y) {
|
public Pip(float x, float y) {
|
||||||
location = new Vector2(x, y);
|
Random rand = new Random();
|
||||||
|
int range = 2;
|
||||||
|
location = new Vector2(x + rand.nextInt(-range, range + 1), y+ rand.nextInt(-range, range + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getX() {
|
public float getX() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue