From a428fc7a87852f6d48e5195b4e4276fdc04f453c Mon Sep 17 00:00:00 2001 From: Rosia E Evans Date: Sat, 20 Apr 2024 16:49:01 +0100 Subject: [PATCH] adds variation to die faces --- core/src/com/monjaro/gamejam/Face.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/com/monjaro/gamejam/Face.java b/core/src/com/monjaro/gamejam/Face.java index fd7b482..e7e853d 100644 --- a/core/src/com/monjaro/gamejam/Face.java +++ b/core/src/com/monjaro/gamejam/Face.java @@ -8,6 +8,7 @@ import com.badlogic.gdx.math.Vector2; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.Random; public class Face extends Actor{ @@ -19,6 +20,7 @@ public class Face extends Actor{ private static Texture blankFaceSprite; private static Texture pipSprite; + public Face(int pipCount) { addPipsForValue(pipCount); } @@ -53,7 +55,9 @@ public class Face extends Actor{ private final Vector2 location; 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() {